Skip to content

Commit

Permalink
Skip duplicates Github actions run
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed Mar 20, 2021
1 parent 4bb04e9 commit 95143b0
Showing 1 changed file with 36 additions and 15 deletions.
51 changes: 36 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,27 @@ 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", "**/LICENSE"]'
do_not_skip: '["pull_request"]'

test:
name: Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}}
runs-on: ubuntu-latest
runs-on: ubuntu-18.04
needs: check_duplicate_runs
if: ${{ needs.check_duplicate_runs.outputs.should_skip != 'true' }}

strategy:
matrix:
Expand All @@ -33,31 +51,34 @@ jobs:
uses: actions/cache@v2
with:
path: deps
key: ${{ runner.os }}-mix-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
key: ${{ runner.os }}-mix-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }}
restore-keys: |
${{ runner.os }}-mix-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
${{ runner.os }}-mix-${{ matrix.otp }}-${{ matrix.elixir }}
${{ runner.os }}-mix-${{ matrix.otp }}
${{ runner.os }}-mix
- name: Restore _build cache
uses: actions/cache@v2
with:
path: _build
key: ${{ runner.os }}-build-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
key: ${{ runner.os }}-build-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
${{ runner.os }}-build-${{ matrix.otp }}-${{ matrix.elixir }}
${{ runner.os }}-build-${{ matrix.otp }}
${{ runner.os }}-build
- name: Install Dependencies
run: |
mix local.hex --force
mix local.rebar --force
mix deps.get --only test
- name: Install hex
run: mix local.hex --force

- name: Install rebar
run: mix local.rebar --force

- name: Install package dependencies
run: mix deps.get

- name: Remove compiled application files
run: mix clean

- name: Compile dependencies
run: mix compile

- name: Run unit tests
run: |
mix clean
mix test
run: mix test

0 comments on commit 95143b0

Please sign in to comment.