From 1cf0c8a255ec7bf8c34e780dceaa74de278738d4 Mon Sep 17 00:00:00 2001 From: dolfinus Date: Sun, 21 Mar 2021 15:54:05 +0300 Subject: [PATCH 1/5] Skip duplicates Github actions run --- .github/workflows/elixir.yml | 65 +++++++++++++++++++++++------------- mix.exs | 3 ++ 2 files changed, 45 insertions(+), 23 deletions(-) diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index 8fb2ceaf54..ad126904b8 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -2,16 +2,32 @@ name: CI on: push: - branches: - - master pull_request: branches: - master jobs: + check_duplicate_runs: + name: Check for duplicate runs + continue-on-error: true + runs-on: ubuntu-latest + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@master + with: + concurrent_skipping: always + cancel_others: true + skip_after_successful_duplicate: true + paths_ignore: '["**/README.md", "**/CHANGELOG.md", "**/CODE_OF_CONDUCT.md", "**/CONTRIBUTING.md", "**/LICENSE.md"]' + do_not_skip: '["pull_request"]' + test: name: Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}} runs-on: ubuntu-latest + needs: check_duplicate_runs + if: ${{ needs.check_duplicate_runs.outputs.should_skip != 'true' }} strategy: matrix: @@ -34,44 +50,47 @@ jobs: - name: Restore deps cache uses: actions/cache@v2 with: - path: deps - key: deps-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} + path: | + deps + _build + key: ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }} restore-keys: | - deps-${{ matrix.otp }}-${{ matrix.elixir }} + ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} + ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }} - - name: Restore _build cache - uses: actions/cache@v2 - with: - path: _build - key: _build-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} - restore-keys: | - _build-${{ matrix.otp }}-${{ matrix.elixir }} + - name: Create dializer plts path + run: mkdir -p priv/plts || true - name: Restore plts cache uses: actions/cache@v2 with: path: priv/plts - key: plts-${{ matrix.otp }}-${{ matrix.elixir }} + key: ${{ runner.os }}-plts-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-plts-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} + ${{ runner.os }}-plts-${{ matrix.otp }}-${{ matrix.elixir }} - - name: Install deps + - name: Install package dependencies run: mix deps.get + - name: Remove compiled application files + run: mix clean + + - name: Compile dependencies + run: mix compile + env: + MIX_ENV: test + - name: Check Formatting run: mix format --check-formatted - name: Run unit tests - run: | - mix clean - mix test + run: mix test - name: Run unit tests with persistent_term backend - run: | - mix clean - mix test + run: mix test env: SCHEMA_PROVIDER: persistent_term - name: Run dialyzer - run: | - mkdir -p priv/plts - MIX_ENV=test mix dialyzer + run: mix dialyzer diff --git a/mix.exs b/mix.exs index 3bce224fd0..14184af5bf 100644 --- a/mix.exs +++ b/mix.exs @@ -14,6 +14,9 @@ defmodule Absinthe.Mixfile do start_permanent: Mix.env() == :prod, package: package(), source_url: @source_url, + preferred_cli_env: [ + dialyzer: :test + ], docs: [ source_ref: "v#{@version}", main: "overview", From 05a9cb95caadbdc12ee558a4273263c287455a49 Mon Sep 17 00:00:00 2001 From: Vince Foley Date: Sun, 21 Mar 2021 11:30:46 -0700 Subject: [PATCH 2/5] Don't use skip for now --- .github/workflows/elixir.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index ad126904b8..8eb7f8385e 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -7,27 +7,9 @@ on: - master jobs: - check_duplicate_runs: - name: Check for duplicate runs - continue-on-error: true - runs-on: ubuntu-latest - outputs: - should_skip: ${{ steps.skip_check.outputs.should_skip }} - steps: - - id: skip_check - uses: fkirc/skip-duplicate-actions@master - with: - concurrent_skipping: always - cancel_others: true - skip_after_successful_duplicate: true - paths_ignore: '["**/README.md", "**/CHANGELOG.md", "**/CODE_OF_CONDUCT.md", "**/CONTRIBUTING.md", "**/LICENSE.md"]' - do_not_skip: '["pull_request"]' - test: name: Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}} runs-on: ubuntu-latest - needs: check_duplicate_runs - if: ${{ needs.check_duplicate_runs.outputs.should_skip != 'true' }} strategy: matrix: From 27f969b4f50467eea6013a8d63768a19aa980eb1 Mon Sep 17 00:00:00 2001 From: Vince Foley Date: Sun, 21 Mar 2021 11:31:03 -0700 Subject: [PATCH 3/5] quick cache key rename --- .github/workflows/elixir.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index 8eb7f8385e..331e3e6ffb 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -35,22 +35,22 @@ jobs: path: | deps _build - key: ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }} + key: deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-${{ github.sha }} restore-keys: | - ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} - ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }} + deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} + deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }} - name: Create dializer plts path - run: mkdir -p priv/plts || true + run: mkdir -p priv/plts - name: Restore plts cache uses: actions/cache@v2 with: path: priv/plts - key: ${{ runner.os }}-plts-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }} + key: plts-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-${{ github.sha }} restore-keys: | - ${{ runner.os }}-plts-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} - ${{ runner.os }}-plts-${{ matrix.otp }}-${{ matrix.elixir }} + plts-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} + plts-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }} - name: Install package dependencies run: mix deps.get @@ -58,7 +58,7 @@ jobs: - name: Remove compiled application files run: mix clean - - name: Compile dependencies + - name: Compile application run: mix compile env: MIX_ENV: test From b3f1bffdd031da6a2bddd5c07e762fd5ce8e74fc Mon Sep 17 00:00:00 2001 From: Vince Foley Date: Sun, 21 Mar 2021 11:48:12 -0700 Subject: [PATCH 4/5] clean before individual runs --- .github/workflows/elixir.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index 331e3e6ffb..3bfdd7467e 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -55,9 +55,6 @@ jobs: - name: Install package dependencies run: mix deps.get - - name: Remove compiled application files - run: mix clean - - name: Compile application run: mix compile env: @@ -67,10 +64,14 @@ jobs: run: mix format --check-formatted - name: Run unit tests - run: mix test + run: | + mix clean + mix test - name: Run unit tests with persistent_term backend - run: mix test + run: | + mix clean + mix test env: SCHEMA_PROVIDER: persistent_term From 45388c4b6cd93f7314794a71d9fe3a71dc5b4d28 Mon Sep 17 00:00:00 2001 From: Vince Foley Date: Sun, 21 Mar 2021 11:51:58 -0700 Subject: [PATCH 5/5] rm explicit compile --- .github/workflows/elixir.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index 3bfdd7467e..5936be28b3 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -55,11 +55,6 @@ jobs: - name: Install package dependencies run: mix deps.get - - name: Compile application - run: mix compile - env: - MIX_ENV: test - - name: Check Formatting run: mix format --check-formatted