Skip to content

Commit

Permalink
Update github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
pooyamb committed Jun 20, 2024
1 parent f7fe8b0 commit 6fd5a80
Showing 1 changed file with 10 additions and 49 deletions.
59 changes: 10 additions & 49 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,82 +9,43 @@ on:
env:
CARGO_TERM_COLOR: always

# Copied from sqlx
# TODO: switch from the unmaintained actions-rs to something else
jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

# this is cheaper than requesting the non-minimal profile
- uses: moonrepo/setup-rust@v1
- run: rustup component add rustfmt

- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- run: cargo fmt --all -- --check

check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- uses: actions-rs/cargo@v1
with:
command: check
args: >
--all-features --workspace
- uses: moonrepo/setup-rust@v1
- run: cargo check --all-features --workspace

test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- uses: actions-rs/cargo@v1
with:
command: test
args: >
--all-features --workspace -- --test-threads=1
- uses: moonrepo/setup-rust@v1
- run: cargo test --all-features --workspace -- --test-threads=1

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- uses: moonrepo/setup-rust@v1
- uses: taiki-e/install-action@cargo-llvm-cov

- run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info

- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
files: lcov.info
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }} # required

0 comments on commit 6fd5a80

Please sign in to comment.