Skip to content

Commit a7c605d

Browse files
committed
Add basic Github pipelines
1 parent 84ed49c commit a7c605d

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

.github/actions/setup/action.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Setup
2+
description: Setup environment for CI
3+
4+
inputs:
5+
targets:
6+
description: Comma-separated list of target triples to install for this toolchain
7+
required: false
8+
components:
9+
description: Comma-separated list of components to be additionally installed
10+
required: false
11+
12+
runs:
13+
using: 'composite'
14+
steps:
15+
- shell: bash
16+
run: |
17+
echo $HOME
18+
echo ${{ runner.os }}
19+
20+
- uses: dtolnay/rust-toolchain@stable
21+
with:
22+
toolchain: stable
23+
targets: ${{ inputs.targets }}
24+
components: ${{ inputs.components }}
25+
26+
- uses: Swatinem/rust-cache@v2
27+
with:
28+
key: ${{ runner.os }}-${{ inputs.targets }}-rust-cache

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
RUST_BACKTRACE: 1
12+
13+
concurrency:
14+
group: ${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
clippy:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: ./.github/actions/setup
23+
with:
24+
components: clippy
25+
- run: cargo clippy
26+
27+
unit-test:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: ./.github/actions/setup
32+
- run: cargo test
33+
34+
format-check:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v4
38+
- uses: ./.github/actions/setup
39+
with:
40+
components: rustfmt
41+
- run: cargo fmt --all -- --check

0 commit comments

Comments
 (0)