Skip to content

Commit

Permalink
ci(vrd): 🐛 fix CI jobs and add new ones
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienrousseau committed May 4, 2024
1 parent 6f6abad commit 158949b
Show file tree
Hide file tree
Showing 8 changed files with 152 additions and 167 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: 🧪 Audit
on:
push:
branches:
- main
- feat/vrd
pull_request:
branches:
Expand All @@ -18,6 +19,10 @@ jobs:
- uses: hecrj/setup-rust-action@v2
- name: Install cargo-audit
run: cargo install cargo-audit
- uses: actions/checkout@master
- name: Audit dependencies

- uses: actions/checkout@v4
- name: Resolve dependencies
run: cargo update

- name: Audit vulnerabilities
run: cargo audit
3 changes: 2 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: 🧪 Check
on:
push:
branches:
- main
- feat/vrd
pull_request:
branches:
Expand All @@ -18,6 +19,6 @@ jobs:
- uses: hecrj/setup-rust-action@v2
with:
components: clippy
- uses: actions/checkout@master
- uses: actions/checkout@v4
- name: Check lints
run: cargo check --all-targets --workspace --all-features
61 changes: 61 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: 📶 Coverage

on:
push:
branches:
- main
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
coverage:
name: Code Coverage
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"

steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4

# Setup Rust nightly
- name: Install Rust
uses: actions-rs/toolchain@v1
id: toolchain
with:
toolchain: nightly
override: true

# Configure cache for Cargo
- name: Cache Cargo registry, index
uses: actions/cache@v4
id: cache-cargo
with:
path: |
~/.cargo/registry
~/.cargo/bin
~/.cargo/git
key: linux-${{ steps.toolchain.outputs.rustc_hash }}-rust-cov-${{ hashFiles('**/Cargo.lock') }}

# Run tests with all features
- name: Test (cargo test)
uses: actions-rs/cargo@v1
with:
command: test
args: "--workspace"

# Install grcov
- uses: actions-rs/grcov@v0.1
id: coverage

# Upload to Codecov.io
- name: Upload to Codecov.io
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ${{ steps.coverage.outputs.report }}
10 changes: 6 additions & 4 deletions .github/workflows/document.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ name: 🧪 Document
on:
push:
branches:
- main
- feat/vrd
pull_request:
branches:
- main
- feat/vrd
release:
types: [created]

jobs:
all:
Expand Down Expand Up @@ -43,10 +45,10 @@ jobs:
retention-days: 1

- name: Write CNAME file
run: echo 'doc.vrdlib.com' > ./target/doc/CNAME
run: echo 'docs.shokunin.one' > ./target/doc/CNAME

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
cname: true
commit_message: Deploy documentation at ${{ github.sha }}
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 💾 Format

on:
push:
branches:
- main
- feat/vrd
pull_request:
branches:
- feat/vrd
release:
types: [created]

jobs:
all:
name: Format
runs-on: ubuntu-latest
steps:
- uses: hecrj/setup-rust-action@v2
with:
components: clippy
- uses: actions/checkout@v4
- name: Check format
run: cargo fmt --all -- --check --verbose
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ jobs:
- uses: hecrj/setup-rust-action@v2
with:
components: clippy
- uses: actions/checkout@master
- uses: actions/checkout@v4
- name: Check lints
run: cargo clippy --workspace --all-features --all-targets --no-deps -- -D warnings
run: cargo clippy --workspace --all-features --all-targets --no-deps -- -D warnings
Loading

0 comments on commit 158949b

Please sign in to comment.