Skip to content

Commit

Permalink
chore(.github): added workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mbaertschi committed Jul 26, 2024
1 parent a1dc984 commit e2578b9
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 2 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/ash-pagify-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: AshPagify CI

on:
push:
tags:
- "v*"
branches:
- main

pull_request:
branches:
- main

env:
MIX_ENV: test

permissions:
contents: read

jobs:
test:
name: Run tests
runs-on: hetzner

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
version-file: .tool-versions
version-type: strict

- name: Restore cache
id: cache
uses: actions/cache/restore@v4
with:
path: |
deps
_build
priv/plts
key: ${{ runner.os }}-mix-${{ hashFiles('.tool-versions') }}-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ hashFiles('.tool-versions') }}-
${{ runner.os }}-mix-
- run: mix deps.get
- run: mix compile
- run: mix dialyzer --plt

- name: Save cache
uses: actions/cache/save@v4
if: steps.cache.outputs.cache-hit != 'true'
with:
path: |
deps
_build
priv/plts
key: ${{ runner.os }}-mix-${{ hashFiles('.tool-versions') }}-${{ hashFiles('mix.lock') }}

- run: mix check

- name: Test Summary
uses: test-summary/action@v2
with:
paths: test/reports/test-junit-report.xml
if: always()

release:
name: Release
if: startsWith(github.ref, 'refs/tags/v')
needs: test
runs-on: hetzner
steps:
- uses: actions/checkout@v4
- uses: team-alembic/staple-actions/actions/mix-hex-publish@main
with:
mix-env: dev
hex-api-key: ${{secrets.HEX_API_KEY}}
30 changes: 30 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Dependabot
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Enable auto-merging
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Approve PRs for minor version updates
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
28 changes: 26 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,31 @@ defmodule AshPagify.MixProject do
],
skip_undefined_reference_warnings_on: [
"CHANGELOG.md"
],
nest_modules_by_prefix: [
AshPagify.Error,
AshPagify.Components
],
groups_for_modules: [
Core: [
AshPagify,
AshPagify.Meta,
AshPagify.Misc,
AshPagify.Tsearch,
AshPagify.Validation
],
Components: [
AshPagify.Components,
AshPagify.Components.Pagination,
AshPagify.Components.Table
],
Filters: [
AshPagify.FilterForm
],
Errors: [
AshPagify.Error,
~r/AshPagify.Error\./
]
]
]
end
Expand Down Expand Up @@ -113,8 +138,7 @@ defmodule AshPagify.MixProject do
# Setup Project
setup: [
"deps.get",
"check",
"docs"
"check"
]
]
end
Expand Down

0 comments on commit e2578b9

Please sign in to comment.