Skip to content

Commit c78c484

Browse files
committed
Add CI workflow
1 parent daa5b69 commit c78c484

File tree

2 files changed

+31
-23
lines changed

2 files changed

+31
-23
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
merge_group:
6+
workflow_dispatch:
7+
workflow_call:
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
- uses: dtolnay/rust-toolchain@stable
18+
with:
19+
targets: thumbv7m-none-eabi
20+
- uses: actions/setup-python@v6
21+
with:
22+
python-version: "3.13"
23+
- run: cargo build --release --features=stm32f100,xC
24+
- run: python3.13 scripts/build.py build --release
25+
- run: python3.13 scripts/build.py clippy
26+
- run: python3.13 scripts/build.py test
27+
- run: python3.13 scripts/build.py build --example=f103c8

.github/workflows/release.yml

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,18 @@
11
name: Release
22

33
on:
4-
pull_request:
5-
merge_group:
64
workflow_dispatch:
75
push:
8-
branches:
9-
- main
106
tags:
117
- "v*"
128

139
jobs:
14-
test:
15-
runs-on: ubuntu-latest
16-
steps:
17-
- uses: actions/checkout@v6
18-
- uses: dtolnay/rust-toolchain@stable
19-
with:
20-
targets: thumbv7m-none-eabi
21-
- uses: actions/setup-python@v6
22-
with:
23-
python-version: "3.13"
24-
- run: cargo build --release --features=stm32f100,xC
25-
- run: python3.13 scripts/build.py build --release
26-
- run: python3.13 scripts/build.py clippy
27-
- run: python3.13 scripts/build.py test
28-
- run: python3.13 scripts/build.py build --example=f103c8
10+
ci:
11+
uses: ./.github/workflows/ci.yml
2912

3013
publish:
3114
if: github.ref_type == 'tag'
32-
needs: test
15+
needs: ci
3316
runs-on: ubuntu-latest
3417
environment: release # Optional: for enhanced security
3518
permissions:
@@ -39,12 +22,10 @@ jobs:
3922
- uses: dtolnay/rust-toolchain@stable
4023
with:
4124
targets: thumbv7m-none-eabi
42-
# - name: Dry run
43-
# if: github.ref_type != 'tag'
44-
# run: cargo publish --features=stm32f103,xG --dry-run
4525
- uses: rust-lang/crates-io-auth-action@v1
4626
id: auth
4727
- name: Publish crate
4828
run: cargo publish --features=stm32f103,xG
29+
# run: cargo publish --features=stm32f103,xG --dry-run
4930
env:
5031
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}

0 commit comments

Comments
 (0)