Skip to content

Commit

Permalink
Update CI actions to match the newer setup of manul
Browse files Browse the repository at this point in the history
  • Loading branch information
fjarri committed Nov 19, 2024
1 parent 69a75d8 commit 980e74a
Show file tree
Hide file tree
Showing 7 changed files with 1,544 additions and 112 deletions.
126 changes: 126 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: ci
on:
workflow_dispatch:
pull_request:
paths-ignore: [README.md]
push:
branches: master
paths-ignore: [README.md]

env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Dwarnings"

jobs:
wasm-build:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- 1.81.0 # MSRV
- stable
target:
- wasm32-unknown-unknown
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
- run: cargo build --target ${{ matrix.target }} --no-default-features
- run: cargo build --target ${{ matrix.target }}

test-and-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
with:
profile: minimal
toolchain: stable
target: x86_64-unknown-linux-gnu
override: true
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --workspace --all-features --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true

# This is supposed to factor out possible bugs introduced by Rust compiler changes
# and dependency changes, making the results more reproducible.
stable-test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
rust: 1.81.0 # MSRV
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
profile: minimal
override: true
- run: ${{ matrix.deps }}
- run: cargo test --workspace --locked --all-features --target ${{ matrix.target }}

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.81.0 # MSRV
components: clippy
override: true
profile: minimal
- run: cargo clippy --all --all-features --tests --benches -- -D warnings

# Mimics the setup of docs.rs, but fails on warnings
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: minimal
- run: env RUSTDOCFLAGS='--cfg docsrs -D warnings' cargo doc --all-features

rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
components: rustfmt
profile: minimal
override: true
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

semver:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
components: rustfmt
profile: minimal
override: true
- uses: obi1kenobi/cargo-semver-checks-action@v2
with:
package: synedrion
feature-group: all-features
41 changes: 0 additions & 41 deletions .github/workflows/lint.yml

This file was deleted.

66 changes: 0 additions & 66 deletions .github/workflows/test.yml

This file was deleted.

7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
target/
synedrion-wasm/pkg/
node_modules
Cargo.lock
/target
*.sublime-project
*.sublime-workspace
Loading

0 comments on commit 980e74a

Please sign in to comment.