From 20286f1dff79e90a2b2d0a0528be1d88caff8222 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Thu, 27 Aug 2020 22:40:05 -0400 Subject: [PATCH] chore: only run coverage once --- .check.exs | 7 ------- .github/workflows/elixir.yml | 27 +++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.check.exs b/.check.exs index 140d241..cbcf64e 100644 --- a/.check.exs +++ b/.check.exs @@ -11,13 +11,6 @@ ## ...or adjusted (e.g. use one-line formatter for more compact credo output) # {:credo, "mix credo --format oneline"}, - {:ex_unit, - command: - if System.get_env("ASH_CI") == "true" do - "mix coveralls.github" - else - "mix test" - end}, {:check_formatter, command: "mix ash.formatter --check"} ## custom new tools may be added (mix tasks or arbitrary commands) diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index 896a6d1..e794484 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -20,7 +20,6 @@ jobs: ash: ["master", "1.11.0", "1.10.0"] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ASH_CI: true ASH_VERSION: ${{matrix.ash}} steps: - run: sudo apt-get install --yes erlang-dev @@ -46,6 +45,31 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') - run: mix check if: "!startsWith(github.ref, 'refs/tags/v')" + coverage: + needs: [build] + runs-on: ubuntu-latest + name: Report Test Coverage + strategy: + matrix: + otp: ["23"] + elixir: ["1.10.0"] + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - run: sudo apt-get install --yes erlang-dev + - uses: actions/checkout@v2 + - uses: actions/setup-elixir@v1 + with: + otp-version: ${{matrix.otp}} + elixir-version: ${{matrix.elixir}} + - uses: actions/cache@v1 + id: cache-deps + with: + path: deps + key: otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-deps-2-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} + restore-keys: otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-deps-2- + - run: mix deps.get + - run: mix coveralls.github release: needs: [build] if: startsWith(github.ref, 'refs/tags/v') @@ -57,7 +81,6 @@ jobs: elixir: ["1.10.0"] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ASH_CI: true steps: - run: sudo apt-get install --yes erlang-dev - uses: actions/checkout@v2