Skip to content

Commit

Permalink
ci: add CI... :)
Browse files Browse the repository at this point in the history
  • Loading branch information
onkoe committed Jul 10, 2024
1 parent e5ed411 commit 6b9c940
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: pisserror CI

on:
push:
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
run_checks:
name: pisserror
runs-on: ubuntu-22.04
strategy:
matrix:
toolchain:
- stable
- nightly
fail-fast: false

steps:
- uses: actions/checkout@v4

- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}

- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo build
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo bin
uses: actions/cache@v3
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-cargo-bin-${{ hashFiles('**/Cargo.lock') }}

- uses: taiki-e/install-action@v2
with:
tool: cargo-deny,cargo-all-features,cargo-semver-checks

- name: Check semantic versioning adherence # note: this should always work. it's got one line of code...
run: cargo semver-checks

- name: Build
run: cargo build --verbose

- name: Test `pisserror` crate
run: cargo test-all-features

- name: Test `macros` crate
run: cargo test-all-features macros/

- name: Run cargo-deny
run: cargo deny check


6 changes: 6 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[licenses]
allow = ["MIT", "Apache-2.0", "Unicode-DFS-2016"]

[bans]
# disable duplicate crates
multiple-versions = "deny"
1 change: 1 addition & 0 deletions macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "macros"
version = "0.1.0"
edition = "2021"
license-file = "../LICENSE"

[lib]
proc-macro = true
Expand Down

0 comments on commit 6b9c940

Please sign in to comment.