Skip to content

Commit 0708ee9

Browse files
committed
CI: Add GitHub Actions workflows
1 parent e78aa40 commit 0708ee9

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
permissions: {}
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
# renovate: datasource=github-tags depName=rust lookupName=rust-lang/rust versioning=semver
14+
RUST_VERSION: 1.90.0
15+
16+
jobs:
17+
ci:
18+
name: CI
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
23+
with:
24+
persist-credentials: false
25+
26+
- uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921 # master
27+
with:
28+
toolchain: ${{ env.RUST_VERSION }}
29+
components: clippy, rustfmt
30+
31+
- uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
32+
33+
- run: cargo fetch --locked
34+
- run: cargo test
35+
- run: cargo clippy --all-targets --all-features -- -D warnings
36+
- run: cargo fmt --all --check
37+
- run: cargo doc --no-deps --document-private-items --all-features
38+
env:
39+
RUSTDOCFLAGS: "-D warnings"

.github/workflows/release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
# Triggers when pushing tags starting with 'v'
6+
tags: ['v*']
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
12+
environment: release
13+
permissions:
14+
id-token: write
15+
16+
steps:
17+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
18+
with:
19+
persist-credentials: false
20+
21+
- uses: rust-lang/crates-io-auth-action@e919bc7605cde86df457cf5b93c5e103838bd879 # v1.0.1
22+
id: auth
23+
24+
- run: cargo publish
25+
env:
26+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}

0 commit comments

Comments
 (0)