Skip to content

Commit

Permalink
add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
wborgeaud committed Oct 27, 2023
1 parent 7404c00 commit 418b19e
Showing 1 changed file with 87 additions and 0 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Continuous Integration

on:
push:
branches: [main]
pull_request:
branches:
- "**"

jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install nightly toolchain
id: rustc-toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2023-06-27
override: true

- name: rust-cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: rustc-test-${{ steps.rustc-toolchain.outputs.rustc_hash }}-cargo-${{ hashFiles('**/Cargo.toml') }}

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
env:
CARGO_INCREMENTAL: 1

lints:
name: Formatting and Clippy
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install nightly toolchain
id: rustc-toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2023-06-27
override: true
components: rustfmt, clippy

- name: rust-cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: rustc-lints-${{ steps.rustc-toolchain.outputs.rustc_hash }}-cargo-${{ hashFiles('**/Cargo.toml') }}

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
env:
CARGO_INCREMENTAL: 1

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features --all-targets -- -D warnings -A incomplete-features
env:
CARGO_INCREMENTAL: 1

0 comments on commit 418b19e

Please sign in to comment.