chore: only run coverage once (#103)

This commit is contained in:
Zach Daniel 2020-08-27 22:49:10 -04:00 committed by GitHub
parent c5c51ebed9
commit eb63bc9d4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 9 deletions

View file

@ -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)

View file

@ -26,7 +26,6 @@ jobs:
otp: 23.0.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ASH_CI: true
steps:
- run: sudo apt-get install --yes erlang-dev
- uses: actions/checkout@v2
@ -51,6 +50,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')
@ -62,7 +86,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