Skip to content

Commit

Permalink
chore: run CI tests when targeting v2 branch (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
hauleth authored Jul 2, 2024
1 parent 9f56b87 commit b0cf07f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 85 deletions.
114 changes: 30 additions & 84 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
pull_request:
branches:
- main
- v2

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -37,49 +38,6 @@ jobs:
- name: Install dependencies
run: mix deps.get

compile:
name: Compile project in test env
runs-on: u22-arm-runner
needs: [deps]

steps:
- uses: actions/checkout@v4
- name: Setup Elixir
id: beam
uses: erlef/setup-beam@v1
with:
otp-version: '25.3.2.7'
elixir-version: '1.14.5'
- name: Cache Mix
uses: actions/cache@v4
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-mix-
- name: Cache Build
uses: actions/cache@v4
with:
path: |
_build/${{ env.MIX_ENV }}
key: ${{ runner.os }}-build-${{ env.MIX_ENV }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-${{ env.MIX_ENV }}-
- name: Cache native
uses: actions/cache@v4
id: native-cache
with:
path: |
priv/native
key: ${{ runner.os }}-build-native-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles(format('{0}{1}', github.workspace, '/native/**/*')) }}
- name: Set up Rust
uses: dtolnay/rust-toolchain@v1
if: steps.native-cache.outputs.cache-hit != 'true' || steps.elixir-cache.output.cache-hit != 'true'
with:
toolchain: stable
- name: Compile
run: mix compile

format:
name: Formatting checks
runs-on: u22-arm-runner
Expand All @@ -98,15 +56,13 @@ jobs:
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-mix-
- name: Run format check
run: mix format --check-formatted

credo:
name: Code style
runs-on: u22-arm-runner
needs: [compile]
needs: [deps]

steps:
- uses: actions/checkout@v4
Expand All @@ -121,23 +77,15 @@ jobs:
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-mix-
- name: Cache Build
uses: actions/cache@v4
with:
path: |
_build/${{ env.MIX_ENV }}
key: ${{ runner.os }}-build-${{ env.MIX_ENV }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-${{ env.MIX_ENV }}-
- name: Compile deps
run: mix deps.compile
- name: Credo checks
run: mix credo --strict --mute-exit-status

tests:
name: Run tests
runs-on: u22-arm-runner
needs: [compile]
needs: [deps]

steps:
- uses: actions/checkout@v4
Expand All @@ -149,30 +97,29 @@ jobs:
elixir-version: '1.14.5'
- name: Set up Rust
uses: dtolnay/rust-toolchain@v1
if: steps.native-cache.outputs.cache-hit != 'true' || steps.elixir-cache.output.cache-hit != 'true'
with:
toolchain: stable
- name: Cache Mix
uses: actions/cache@v4
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-mix-
- name: Cache Build
uses: actions/cache@v4
with:
path: |
_build/${{ env.MIX_ENV }}
key: ${{ runner.os }}-build-${{ env.MIX_ENV }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-${{ env.MIX_ENV }}-
- name: Cache native
uses: actions/cache@v4
with:
path: |
priv/native
key: ${{ runner.os }}-build-native-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles(format('{0}{1}', github.workspace, '/native/**/*')) }}
_build/${{ env.MIX_ENV }}/lib/supavisor/native
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-build-native-${{ hashFiles(format('{0}{1}', github.workspace, '/native/**/Cargo.lock')) }}
restore-keys: |
${{ runner.os }}-build-native-
- name: Compile deps
run: mix deps.compile
- name: Compile
run: mix compile
- name: Set up Postgres
run: docker-compose -f ./docker-compose.db.yml up -d
- name: Start epmd
Expand All @@ -183,7 +130,7 @@ jobs:
dialyzer:
name: Dialyze
runs-on: u22-arm-runner
needs: [compile]
needs: [deps]

steps:
- uses: actions/checkout@v4
Expand All @@ -195,30 +142,29 @@ jobs:
elixir-version: '1.14.5'
- name: Set up Rust
uses: dtolnay/rust-toolchain@v1
if: steps.native-cache.outputs.cache-hit != 'true' || steps.elixir-cache.output.cache-hit != 'true'
with:
toolchain: stable
- name: Cache Mix
uses: actions/cache@v4
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-mix-
- name: Cache Build
uses: actions/cache@v4
with:
path: |
_build/${{ env.MIX_ENV }}
key: ${{ runner.os }}-build-${{ env.MIX_ENV }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-${{ env.MIX_ENV }}-
- name: Cache native
uses: actions/cache@v4
with:
path: |
priv/native
key: ${{ runner.os }}-build-native-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles(format('{0}{1}', github.workspace, '/native/**/*')) }}
_build/${{ env.MIX_ENV }}/lib/supavisor/native
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-build-native-${{ hashFiles(format('{0}{1}', github.workspace, '/native/**/Cargo.lock')) }}
restore-keys: |
${{ runner.os }}-build-native-
- name: Compile deps
run: mix deps.compile
- name: Compile
run: mix compile
- name: Retrieve PLT Cache
uses: actions/cache@v4
id: plt-cache
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.67
1.1.68
1 change: 1 addition & 0 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,4 @@
"websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"},
"websock_adapter": {:hex, :websock_adapter, "0.5.5", "9dfeee8269b27e958a65b3e235b7e447769f66b5b5925385f5a569269164a210", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "4b977ba4a01918acbf77045ff88de7f6972c2a009213c515a445c48f224ffce9"},
}

0 comments on commit b0cf07f

Please sign in to comment.