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: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 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: 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 - name: Upload to codecov.io
uses: codecov/codecov-action@v3 uses: codecov/codecov-action@v3
with: with:

13
.github/workflows/release.yml

@ -30,6 +30,19 @@ jobs:
- name: Checkout source code - name: Checkout source code
uses: actions/checkout@v3 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 - name: Install prerequisites
shell: bash shell: bash
run: | run: |

49
.github/workflows/test.yml

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