Skip to content

Commit 82abfdc

Browse files
committed
Add github workflows
1 parent 6ab66f5 commit 82abfdc

File tree

3 files changed

+108
-0
lines changed

3 files changed

+108
-0
lines changed

.github/workflows/CI.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
name: CI
3+
4+
on:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: >-
12+
${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number
13+
|| github.sha }}
14+
cancel-in-progress: true
15+
16+
env:
17+
COLUMNS: 120
18+
19+
jobs:
20+
lint:
21+
runs-on: ubuntu-22.04
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: dtolnay/rust-toolchain@stable
25+
- uses: Swatinem/rust-cache@v2
26+
- name: Clippy
27+
run: cargo clippy --all-targets --all-features
28+
- name: Format
29+
run: cargo fmt --all --check
30+
cargo-test:
31+
runs-on: ubuntu-22.04
32+
strategy:
33+
matrix:
34+
rust_version: ["stable"]
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: dtolnay/rust-toolchain@master
38+
with:
39+
toolchain: ${{ matrix.rust_version }}
40+
- uses: Swatinem/rust-cache@v2
41+
- name: Test
42+
run: cargo test
43+
spellcheck:
44+
runs-on: ubuntu-22.04
45+
steps:
46+
- uses: actions/checkout@v4
47+
- uses: actions/setup-python@v5
48+
with:
49+
python-version: "3.12"
50+
- run: pip3 install codespell
51+
- uses: codespell-project/codespell-problem-matcher@v1
52+
- name: check for typos
53+
run: codespell --ignore-words=.codespellignore src/ tests/ docs/ README.md

.github/workflows/benchmark.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Benchmarks
3+
4+
on:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
workflow_dispatch:
9+
10+
env:
11+
COLUMNS: 120
12+
13+
jobs:
14+
benchmarks:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Setup rust toolchain, cache and cargo-codspeed binary
19+
uses: moonrepo/setup-rust@v1
20+
with:
21+
channel: stable
22+
cache-target: release
23+
bins: cargo-codspeed
24+
- name: Build the benchmark target(s)
25+
run: cargo codspeed build
26+
- name: Run the benchmarks
27+
uses: CodSpeedHQ/action@v2
28+
with:
29+
run: cargo codspeed run
30+
token: ${{ secrets.CODSPEED_TOKEN }}

.github/workflows/release.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Release
3+
4+
on:
5+
release:
6+
types: [published]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref_name }}
10+
cancel-in-progress: true
11+
12+
env:
13+
COLUMNS: 120
14+
15+
jobs:
16+
cargo-publish:
17+
runs-on: ubuntu-22.04
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: dtolnay/rust-toolchain@stable
21+
- uses: Swatinem/rust-cache@v2
22+
- name: Publish
23+
run: cargo publish --no-verify
24+
env:
25+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)