Add constraints phase #33
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Elixir CI Checks | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
DEPENDENCY_FILE: mix.lock | |
ELIXIR_VERSION: 1.16.2 # Elixir version used during package publishing | |
JOB_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
OTP_VERSION: 26.2.5 # OTP version used during package publishing | |
RELEVANT_FILES: "mix.lock mix.exs lib config test" # Important, this controls the caching, make sure to keep this right | |
REPOSITORY: absinthe_helpers | |
RUNNER_OS: ubuntu22 # Must match Elixir/OTP version in described in action erlef/setup-beam@v1 | |
SHA: ${{ github.sha }} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: | |
- synchronize | |
- opened | |
- reopened | |
jobs: | |
static: | |
name: Static Checks (Elixir ${{ matrix.versions.elixir-version }}) | |
runs-on: runs-on,runner=4cpu-linux-x64 | |
outputs: | |
HASH: ${{ steps.prepare.outputs.HASH }} | |
strategy: | |
fail-fast: false | |
matrix: | |
versions: | |
- { elixir-version: 1.16.2, otp-version: 26.2.5, runner-os: 'ubuntu22' } | |
steps: | |
- name: Checkout and compile dependencies | |
id: prepare | |
uses: surgeventures/platform-tribe-actions/elixir/precompile@fast-elixir-repo-setup | |
with: | |
repository: ${{ env.REPOSITORY }} | |
dependency-file: ${{ env.DEPENDENCY_FILE }} | |
sha: ${{ env.SHA }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
hex-token: ${{ secrets.HEX_ORGANIZATION_KEY }} | |
mix-env: dev | |
relevant-files: ${{ env.RELEVANT_FILES }} | |
elixir-version: ${{ matrix.versions.elixir-version }} | |
otp-version: ${{ matrix.versions.otp-version }} | |
runner-os: ${{ matrix.versions.runner-os }} | |
- name: Compile the application | |
id: compile | |
uses: surgeventures/platform-tribe-actions/elixir/compile@fast-elixir-repo-setup | |
with: | |
build-hash: ${{ steps.prepare.outputs.HASH }} | |
warnings-as-errors: 'true' | |
elixir-version: ${{ matrix.versions.elixir-version }} | |
otp-version: ${{ matrix.versions.otp-version }} | |
- name: Run Static Checks | |
uses: surgeventures/platform-tribe-actions/elixir/static-check@fast-elixir-repo-setup | |
id: static | |
with: | |
dialyzer: true | |
hex-token: ${{ secrets.HEX_ORGANIZATION_WRITE_KEY }} | |
test: | |
name: Unit Tests (Elixir ${{ matrix.versions.elixir-version }}) | |
runs-on: runs-on,runner=1cpu-linux-x64 | |
strategy: | |
fail-fast: false | |
matrix: | |
versions: | |
- { elixir-version: 1.16.2, otp-version: 26.2.5, runner-os: 'ubuntu22' } | |
steps: | |
- name: Checkout and compile dependencies | |
id: prepare | |
uses: surgeventures/platform-tribe-actions/elixir/precompile@fast-elixir-repo-setup | |
with: | |
repository: ${{ env.REPOSITORY }} | |
dependency-file: ${{ env.DEPENDENCY_FILE }} | |
sha: ${{ env.SHA }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
hex-token: ${{ secrets.HEX_ORGANIZATION_KEY }} | |
mix-env: test | |
relevant-files: ${{ env.RELEVANT_FILES }} | |
elixir-version: ${{ matrix.versions.elixir-version }} | |
otp-version: ${{ matrix.versions.otp-version }} | |
runner-os: ${{ matrix.versions.runner-os }} | |
- name: Compile the application | |
id: compile | |
uses: surgeventures/platform-tribe-actions/elixir/compile@fast-elixir-repo-setup | |
with: | |
build-hash: ${{ steps.prepare.outputs.HASH }} | |
mix-env: test | |
elixir-version: ${{ matrix.versions.elixir-version }} | |
otp-version: ${{ matrix.versions.otp-version }} | |
- name: Run Unit Tests | |
uses: surgeventures/platform-tribe-actions/elixir/test@fast-elixir-repo-setup | |
id: test | |
with: | |
# Updated so that we are not forced to have 90% code | |
# coverage | |
test-params: '' | |
permit: | |
name: Permit Package Publishing | |
needs: [static, test] | |
runs-on: runs-on,runner=1cpu-linux-x64 | |
outputs: | |
PUBLISH: ${{ steps.permit.outputs.PUBLISH }} | |
steps: | |
- name: Verify elibility for publishing the package | |
uses: surgeventures/platform-tribe-actions/elixir/permit@fast-elixir-repo-setup | |
id: permit | |
with: | |
repository: ${{ env.REPOSITORY }} | |
sha: ${{ env.SHA }} | |
relevant-files: ${{ env.RELEVANT_FILES}} | |
publish: | |
name: Publish Hex Package | |
needs: [permit] | |
runs-on: runs-on,runner=2cpu-linux-x64 | |
if: needs.permit.outputs.PUBLISH == 'true' && github.event_name == 'push' | |
steps: | |
- name: Publish Package | |
uses: surgeventures/platform-tribe-actions/elixir/publish@fast-elixir-repo-setup | |
with: | |
repository: ${{ env.REPOSITORY }} | |
sha: ${{ env.SHA }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
hex-token: ${{ secrets.HEX_ORGANIZATION_WRITE_KEY }} | |
elixir-version: ${{ env.ELIXIR_VERSION }} | |
otp-version: ${{ env.OTP_VERSION }} | |
runner-os: ${{ env.RUNNER_OS }} |