Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: introduce github actions CI #38

Merged
merged 4 commits into from
Dec 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Continuous Integration

on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: ["*"]

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Build on ${{ matrix.environments.runner }} with target ${{ matrix.environments.target }}
strategy:
fail-fast: false
matrix:
environments:
- runner: ubuntu-latest
target: x86_64-unknown-linux-gnu
- runner: ubuntu-latest
target: wasm32-unknown-unknown
optional: true
- runner: macos-latest
target: aarch64-apple-darwin
timeout-minutes: 30
runs-on: ${{ matrix.environments.runner }}
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Check format
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- run: rustup target add ${{ matrix.environments.target }}
- name: Run tests
run: |
set +e
cargo test --locked --all-features --workspace --target ${{ matrix.environments.target }}
exitcode="$?"
if [[ "${{ matrix.environments.optional }}" == "true" && "$exitcode" != "0" ]] ; then
# Propagate failure as a warning
# but do not fail the job
echo "::warning::Tests failed with exit code $exitcode"
exit 0
fi
Loading