From 85a2039d8618f24a87532815e7a75f711079b790 Mon Sep 17 00:00:00 2001 From: dolfinus Date: Sat, 20 Mar 2021 23:32:26 +0300 Subject: [PATCH 1/3] Skip duplicates Github actions run --- .github/workflows/test.yml | 147 ++++++++++++++++++------------------- 1 file changed, 71 insertions(+), 76 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3ee34cb..abd5fe5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,70 +7,27 @@ on: - main jobs: - inch: - name: Analyse Documentation - runs-on: ubuntu-18.04 - - strategy: - matrix: - elixir: - - "1.11" - otp: - - "23.0" - + 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: - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up Elixir - uses: actions/setup-elixir@v1 - with: - elixir-version: ${{ matrix.elixir }} - otp-version: ${{ matrix.otp }} - - - name: Restore deps cache - uses: actions/cache@v2 - with: - path: deps - key: ${{ runner.os }}-mix-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} - restore-keys: | - ${{ runner.os }}-mix-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} - ${{ runner.os }}-mix-${{ matrix.otp }}-${{ matrix.elixir }} - - - name: Restore _build cache - uses: actions/cache@v2 - with: - path: _build - key: ${{ runner.os }}-build-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} - restore-keys: | - ${{ runner.os }}-build-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} - ${{ runner.os }}-build-${{ matrix.otp }}-${{ matrix.elixir }} - - - 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: Check documentation quality locally - run: mix inch - - - name: Report documentation quality - if: github.event_name == 'push' - run: mix inch.report + - 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.txt"]' + do_not_skip: '["pull_request"]' test: name: Elixir ${{ matrix.elixir }} / OTP ${{ matrix.otp }} runs-on: ubuntu-18.04 + needs: check_duplicate_runs + if: ${{ needs.check_duplicate_runs.outputs.should_skip != 'true' }} services: postgres: image: postgres @@ -121,26 +78,60 @@ jobs: - name: Restore deps cache uses: actions/cache@v2 with: - path: deps - key: ${{ runner.os }}-mix-${{ 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: | - ${{ runner.os }}-mix-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} - ${{ runner.os }}-mix-${{ matrix.otp }}-${{ matrix.elixir }} + ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} + ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }} + + - 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: Run unit tests + run: mix test + + inch: + name: Analyse Documentation + runs-on: ubuntu-18.04 + needs: test + + strategy: + matrix: + elixir: + - "1.11" + otp: + - "23.0" + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Elixir + uses: actions/setup-elixir@v1 + with: + elixir-version: ${{ matrix.elixir }} + otp-version: ${{ matrix.otp }} - - name: Restore _build cache + - name: Restore deps cache uses: actions/cache@v2 with: - path: _build - key: ${{ runner.os }}-build-${{ 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: | - ${{ runner.os }}-build-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} - ${{ runner.os }}-build-${{ matrix.otp }}-${{ matrix.elixir }} - - - name: Install hex - run: mix local.hex --force - - - name: Install rebar - run: mix local.rebar --force + ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} + ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }} - name: Install package dependencies run: mix deps.get @@ -151,5 +142,9 @@ jobs: - name: Compile dependencies run: mix compile - - name: Run unit tests - run: mix test + - name: Check documentation quality locally + run: mix inch + + - name: Report documentation quality + if: github.event_name == 'push' + run: mix inch.report \ No newline at end of file From a68f5961fca026d28d39c787a8e6a004a09df84f Mon Sep 17 00:00:00 2001 From: Martynov Maxim Date: Tue, 6 Apr 2021 11:34:41 +0300 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Sasha Gerrand --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index abd5fe5..b452ee7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: should_skip: ${{ steps.skip_check.outputs.should_skip }} steps: - id: skip_check - uses: fkirc/skip-duplicate-actions@master + uses: fkirc/skip-duplicate-actions@v3.4.0 with: concurrent_skipping: always cancel_others: true @@ -75,7 +75,7 @@ jobs: elixir-version: ${{ matrix.elixir }} otp-version: ${{ matrix.otp }} - - name: Restore deps cache + - name: Restore build and deps caches uses: actions/cache@v2 with: path: | @@ -122,7 +122,7 @@ jobs: elixir-version: ${{ matrix.elixir }} otp-version: ${{ matrix.otp }} - - name: Restore deps cache + - name: Restore build and deps caches uses: actions/cache@v2 with: path: | @@ -147,4 +147,4 @@ jobs: - name: Report documentation quality if: github.event_name == 'push' - run: mix inch.report \ No newline at end of file + run: mix inch.report From 640594c9904db6c00d286b79c27eb3474e708a9f Mon Sep 17 00:00:00 2001 From: Martynov Maxim Date: Tue, 6 Apr 2021 18:03:49 +0300 Subject: [PATCH 3/3] Update test.yml --- .github/workflows/test.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b452ee7..d007507 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -81,9 +81,8 @@ jobs: path: | deps _build - key: ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }} + key: ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} restore-keys: | - ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }} - name: Install package dependencies @@ -128,9 +127,8 @@ jobs: path: | deps _build - key: ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }} + key: ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} restore-keys: | - ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }} - name: Install package dependencies