Skip to content

Commit 5c17511

Browse files
committed
added github actions first draft
1 parent e089178 commit 5c17511

6 files changed

Lines changed: 173 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Clippy Check Reusable
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
path:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
clippy:
12+
runs-on: ubuntu-latest
13+
14+
defaults:
15+
run:
16+
working-directory: ${{ inputs.path }}
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Install Rust
23+
uses: actions-rs/toolchain@v1
24+
with:
25+
toolchain: stable
26+
profile: minimal
27+
components: clippy
28+
29+
- name: Run Clippy
30+
run: cargo clippy --all-targets -- -D warnings
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Cargo Format
2+
3+
on:
4+
push:
5+
paths:
6+
- '**/*.rs'
7+
pull_request:
8+
paths:
9+
- '**/*.rs'
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
14+
jobs:
15+
format:
16+
name: Check Format
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install Rust toolchain
22+
uses: actions-rs/toolchain@v1
23+
with:
24+
toolchain: nightly
25+
override: true
26+
components: rustfmt
27+
28+
- name: Check formatting
29+
run: cargo fmt --all -- --check

.github/workflows/global-check.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Cargo Check
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Cargo Format"]
6+
types:
7+
- completed
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
check:
14+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Install OS dependencies
20+
run: sudo apt-get update && sudo apt-get install -y libfontconfig-dev
21+
- name: Set up Rust
22+
uses: actions-rs/toolchain@v1
23+
with:
24+
toolchain: stable
25+
override: true
26+
- name: Run check
27+
run: cargo check
28+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Cargo Clippy
2+
3+
4+
on:
5+
workflow_run:
6+
workflows: ["Cargo Check"]
7+
types:
8+
- completed
9+
10+
env:
11+
CARGO_TERM_COLOR: always
12+
13+
jobs:
14+
clippy:
15+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Install OS dependencies
21+
run: sudo apt-get update && sudo apt-get install -y libfontconfig-dev
22+
- name: Install Clippy
23+
run:
24+
rustup toolchain install stable --component clippy
25+
- name: Set up Rust
26+
uses: actions-rs/toolchain@v1
27+
with:
28+
toolchain: stable
29+
override: true
30+
- name: Run clippy
31+
run: cargo clippy
32+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: TOML Format
2+
3+
on:
4+
push:
5+
paths:
6+
- '**/Cargo.toml'
7+
pull_request:
8+
paths:
9+
- '**/Cargo.toml'
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
14+
jobs:
15+
format:
16+
name: TOML Check Format
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install Taplo CLI
22+
uses: taiki-e/install-action@v2
23+
with:
24+
tool: taplo-cli
25+
26+
- name: Check TOML formatting
27+
run: taplo fmt --check
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: TOML Format
2+
3+
on:
4+
push:
5+
paths:
6+
- '**/Cargo.toml'
7+
pull_request:
8+
paths:
9+
- '**/Cargo.toml'
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
14+
jobs:
15+
format:
16+
name: TOML Check Format
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install Taplo CLI
22+
uses: taiki-e/install-action@v2
23+
with:
24+
tool: taplo-cli
25+
26+
- name: Check TOML formatting
27+
run: taplo fmt --check

0 commit comments

Comments
 (0)