Skip to content

Commit 6e33c71

Browse files
jd-apprenticeSergioRibera
authored andcommitted
ci: prep for release
1 parent ce5501d commit 6e33c71

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed

.github/workflows/cargo-action.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Checkout Rust
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
runs-on:
7+
default: ubuntu-latest
8+
required: false
9+
type: string
10+
name:
11+
default: cargo-action
12+
required: false
13+
type: string
14+
command:
15+
default: check
16+
required: false
17+
type: string
18+
args:
19+
default: ""
20+
required: false
21+
type: string
22+
23+
jobs:
24+
cargo-action:
25+
permissions:
26+
contents: read
27+
28+
name: ${{ inputs.name }}
29+
runs-on: ${{ inputs.runs-on }}
30+
steps:
31+
32+
- uses: actions/checkout@v4
33+
- uses: actions-rs/toolchain@v1
34+
with:
35+
toolchain: stable
36+
37+
- uses: actions-rs/cargo@v1
38+
with:
39+
command: ${{ inputs.command }}
40+
args: ${{ inputs.args }}

.github/workflows/ci-cd.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI/CD
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
pull_request:
7+
push:
8+
branches:
9+
- main
10+
- dev
11+
paths:
12+
- "src/**/**.rs"
13+
- "crates/**/**.rs"
14+
- "kernel/*.rs"
15+
16+
jobs:
17+
quality-gate:
18+
uses: RustLangES/.github/.github/workflows/quality-gate.yml@main
19+
with:
20+
runs-on: ubuntu-latest
21+
checks-command: "--all --check"
22+
clippy-command: "-- -D warnings"
23+
tests-command: "test"
24+
25+
build_and_test:
26+
needs: quality-gate
27+
name: Rust project
28+
runs-on: ubuntu-latest
29+
steps:
30+
31+
- uses: ./.github/actions/cargo-action.yml
32+
with:
33+
runs-on: ubuntu-latest
34+
name: cargo-action
35+
command: build
36+
args: "--release --all-features"

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: test and publish
2+
3+
on:
4+
workflow_run:
5+
workflows: ["CI/CD"]
6+
types:
7+
- completed
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
if: ${{ github.ref == 'refs/heads/main' }}
16+
steps:
17+
18+
- name: release
19+
run: |
20+
echo "ToDo: release"

0 commit comments

Comments
 (0)