Browse Source

Move from actions-rs/tarpaulin to actions/cache

update-github-actions
JuanLeon Lahoz 3 years ago
parent
commit
9fa1015132
  1. 22
      .github/workflows/coverage.yml
  2. 13
      .github/workflows/release.yml
  3. 49
      .github/workflows/test.yml

22
.github/workflows/coverage.yml

@ -13,10 +13,26 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Run cargo-tarpaulin
uses: actions-rs/tarpaulin@v0.1
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
args: '-- --test-threads 1'
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Install cargo-tarpaulin
run: cargo install cargo-tarpaulin
- name: Run cargo-tarpaulin
run: cargo tarpaulin --out xml --ignore-tests -- --test-threads 1
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
with:

13
.github/workflows/release.yml

@ -30,6 +30,19 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v3
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Install prerequisites
shell: bash
run: |

49
.github/workflows/test.yml

@ -10,18 +10,37 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
# We need to avoid concurrency running tests (that are very fast,
# anyways), in order to to avoid false positives when testing if writing
# colored output in the terminal is enabled or disabled (a test could
# enable it while other is running and checking if is disabled).
run: cargo test -- --test-threads=1
- name: Check format
run: cargo fmt -- --check
- name: Get clippy version
run: cargo clippy -V
- name: Run clippy
run: cargo clippy -- -D clippy::all
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Build
run: cargo build --verbose
- name: Run tests
# We need to avoid concurrency running tests (that are very fast,
# anyways), in order to to avoid false positives when testing if writing
# colored output in the terminal is enabled or disabled (a test could
# enable it while other is running and checking if is disabled).
run: cargo test -- --test-threads=1
- name: Check format
run: cargo fmt -- --check
- name: Get clippy version
run: cargo clippy -V
- name: Run clippy
run: cargo clippy -- -D clippy::all

Loading…
Cancel
Save