Skip to content

Commit 28708f1

Browse files
bors[bot]burrbull
andauthored
Merge #701
701: Rust svdtools for CI r=adamgreig a=burrbull Co-authored-by: Andrey Zgarbul <zgarbul.andrey@gmail.com>
2 parents 5218ade + a898b9e commit 28708f1

File tree

6 files changed

+105
-80
lines changed

6 files changed

+105
-80
lines changed

.github/bors.toml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,4 @@
11
required_approvals = 1
22
block_labels = ["wip"]
33
delete_merged_branches = true
4-
status = [
5-
"Check (stm32f0)",
6-
"Check (stm32f1)",
7-
"Check (stm32f2)",
8-
"Check (stm32f3)",
9-
"Check (stm32f4)",
10-
"Check (stm32f7)",
11-
"Check (stm32h7)",
12-
"Check (stm32l0)",
13-
"Check (stm32l1)",
14-
"Check (stm32l4)",
15-
"Check (stm32l5)",
16-
"Check (stm32g0)",
17-
"Check (stm32g4)",
18-
"Check (stm32mp1)",
19-
"Check (stm32wl)",
20-
"Check (stm32wb)",
21-
]
4+
status = ["CI"]

.github/workflows/ci.yaml

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

3+
env:
4+
SVDTOOLS_VERSION: 0.2.1
5+
SVD2RUST_VERSION: 0.21.0
6+
FORM_VERSION: 0.8.0
7+
38
on:
49
push:
510
branches: [ staging, trying, master ]
611
pull_request:
712

813
jobs:
14+
ci:
15+
name: CI
16+
runs-on: ubuntu-latest
17+
needs: [check]
18+
steps:
19+
- name: Done
20+
run: exit 0
21+
922
check:
1023
name: Check
1124
runs-on: ubuntu-latest
@@ -28,51 +41,50 @@ jobs:
2841
- stm32mp1
2942
- stm32wl
3043
- stm32wb
44+
3145
env:
3246
CRATES: ${{ matrix.crate }}
3347
CARGO_INCREMENTAL: 0
48+
SVDTOOLS: svdtools
49+
3450
steps:
3551
- name: Checkout code
3652
uses: actions/checkout@v2
53+
3754
- name: Install Rust
3855
uses: actions-rs/toolchain@v1
3956
with:
4057
toolchain: stable
4158
profile: minimal
4259
override: true
4360
components: rustfmt
61+
4462
- name: Install xmllint
4563
run: sudo apt-get install libxml2-utils
46-
- name: Install Python dependencies
47-
run: |
48-
pip3 install --user setuptools wheel
49-
pip3 install --user svdtools
50-
- name: Put pip binary directory into path
51-
run: echo "~/.local/bin" >> $GITHUB_PATH
52-
- name: Cache Cargo installed binaries
53-
uses: actions/cache@v1
54-
id: cache-cargo
55-
with:
56-
path: ~/cargo-bin
57-
key: ${{ runner.os }}-svd2rust-0.21.0
58-
- name: Install svd2rust
59-
if: steps.cache-cargo.outputs.cache-hit != 'true'
60-
uses: actions-rs/install@v0.1
64+
65+
- name: Create working crate
66+
run: make crates
67+
68+
- name: Cache dependencies
69+
uses: Swatinem/rust-cache@v1
6170
with:
62-
crate: svd2rust
63-
version: 0.21.0
64-
- name: Copy svd2rust to cache directory
65-
if: steps.cache-cargo.outputs.cache-hit != 'true'
71+
working-directory: ${{ matrix.crate }}
72+
key: svdtools-${{ env.SVDTOOLS_VERSION }}-svd2rust-${{ env.SVD2RUST_VERSION }}-form-${{ env.FORM_VERSION }}
73+
74+
- name: Install tools
6675
run: |
67-
mkdir ~/cargo-bin
68-
cp ~/.cargo/bin/svd2rust ~/cargo-bin
69-
- name: Put new cargo binary directory into path
70-
run: echo "~/cargo-bin" >> $GITHUB_PATH
76+
cargo install svdtools --version $SVDTOOLS_VERSION --target-dir deps-target
77+
cargo install svd2rust --version $SVD2RUST_VERSION --target-dir deps-target
78+
cargo install form --version $FORM_VERSION --target-dir deps-target
79+
7180
- name: Patch SVDs
7281
run: make -j2 patch
82+
7383
- name: Check SVDs
7484
run: make lint
85+
7586
- name: Build PACs
7687
run: make -j2 svd2rust
88+
7789
- name: Check PACs
7890
run: make -j2 check

.github/workflows/mmaps_master.yaml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: build mmaps
22

3+
env:
4+
SVDTOOLS_VERSION: 0.2.1
5+
36
on:
47
push:
58
branches:
@@ -9,23 +12,36 @@ jobs:
912
build:
1013
name: Build mmaps
1114
runs-on: ubuntu-18.04
15+
16+
env:
17+
SVDTOOLS: svdtools
18+
1219
steps:
1320
- name: Checkout stm32-rs
1421
uses: actions/checkout@v2
1522
with:
1623
path: stm32-rs
24+
1725
- name: Checkout mmaps
1826
uses: actions/checkout@v2
1927
with:
2028
repository: stm32-rs/stm32-rs-mmaps
2129
ssh-key: ${{ secrets.MMAPS_KEY }}
2230
path: stm32-rs-mmaps
23-
- name: Install Python dependencies
31+
32+
- name: Add fictive crate
2433
run: |
25-
pip3 install --user setuptools wheel
26-
pip3 install --user svdtools
27-
- name: Put pip binary directory into path
28-
run: echo "~/.local/bin" >> $GITHUB_PATH
34+
cargo init
35+
36+
- name: Cache dependencies
37+
uses: Swatinem/rust-cache@v1
38+
with:
39+
key: svdtools-${{ env.SVDTOOLS_VERSION }}
40+
41+
- name: Install svdtools
42+
run: |
43+
cargo install svdtools --version $SVDTOOLS_VERSION
44+
2945
- name: Build and publish
3046
run: |
3147
cd stm32-rs

.github/workflows/mmaps_pr.yaml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: compare mmaps
22

3+
env:
4+
SVDTOOLS_VERSION: 0.2.1
5+
36
on:
47
pull_request_target:
58

@@ -8,28 +11,42 @@ jobs:
811
name: Compare mmaps
912
runs-on: ubuntu-18.04
1013
continue-on-error: true
14+
15+
env:
16+
SVDTOOLS: svdtools
17+
1118
steps:
1219
- name: Checkout master
1320
uses: actions/checkout@v2
1421
with:
1522
path: master
23+
1624
- name: Checkout pull request
1725
uses: actions/checkout@v2
1826
with:
1927
ref: refs/pull/${{ github.event.number }}/head
2028
path: pr
29+
2130
- name: Checkout mmaps
2231
uses: actions/checkout@v2
2332
with:
2433
repository: stm32-rs/stm32-rs-mmaps
2534
ssh-key: ${{ secrets.MMAPS_KEY }}
2635
path: mmaps
27-
- name: Install Python dependencies
36+
37+
- name: Add fictive crate
2838
run: |
29-
pip3 install --user setuptools wheel
30-
pip3 install --user svdtools
31-
- name: Put pip binary directory into path
32-
run: echo "~/.local/bin" >> $GITHUB_PATH
39+
cargo init
40+
41+
- name: Cache dependencies
42+
uses: Swatinem/rust-cache@v1
43+
with:
44+
key: svdtools-${{ env.SVDTOOLS_VERSION }}
45+
46+
- name: Install svdtools
47+
run: |
48+
cargo install svdtools --version $SVDTOOLS_VERSION
49+
3350
- name: Build and publish
3451
run: |
3552
# Grab commit ID from checked out PR

.github/workflows/nightlies.yaml

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
name: build nightlies
2+
3+
env:
4+
SVDTOOLS_VERSION: 0.2.1
5+
SVD2RUST_VERSION: 0.21.0
6+
FORM_VERSION: 0.8.0
7+
28
on:
39
push:
410
branches:
@@ -8,49 +14,39 @@ jobs:
814
build:
915
name: Build
1016
runs-on: ubuntu-18.04
17+
18+
env:
19+
SVDTOOLS: svdtools
20+
1121
steps:
1222
- name: Checkout master
1323
uses: actions/checkout@v2
1424
with:
1525
path: stm32-rs
16-
- name: Install Python dependencies
17-
run: |
18-
pip3 install --user setuptools wheel
19-
pip3 install --user svdtools
20-
- name: Put pip binary directory into path
21-
run: echo "~/.local/bin" >> $GITHUB_PATH
26+
2227
- name: Install Rust
2328
uses: actions-rs/toolchain@v1
2429
with:
2530
toolchain: stable
2631
profile: minimal
2732
components: rustfmt
2833
override: true
29-
- name: Cache Cargo installed binaries
30-
uses: actions/cache@v1
31-
id: cache-cargo
32-
with:
33-
path: ~/cargo-bin
34-
key: ${{ runner.os }}-cargo-binaries-0.18.0
35-
- name: Install svd2rust
36-
if: steps.cache-cargo.outputs.cache-hit != 'true'
37-
uses: actions-rs/cargo@v1
38-
with:
39-
command: install
40-
args: svd2rust --version 0.21.0
41-
- name: Install form
42-
if: steps.cache-cargo.outputs.cache-hit != 'true'
43-
uses: actions-rs/cargo@v1
34+
35+
- name: Add fictive crate
36+
run: |
37+
cargo init
38+
39+
- name: Cache dependencies
40+
uses: Swatinem/rust-cache@v1
4441
with:
45-
command: install
46-
args: form --version 0.7.0
47-
- name: Copy svd2rust and form to cache directory
48-
if: steps.cache-cargo.outputs.cache-hit != 'true'
42+
key: svdtools-${{ env.SVDTOOLS_VERSION }}-svd2tust-${{ env.SVD2RUST_VERSION }}-form-${{ env.FORM_VERSION }}
43+
44+
- name: Install dependencies
4945
run: |
50-
mkdir ~/cargo-bin
51-
cp ~/.cargo/bin/{svd2rust,form} ~/cargo-bin
52-
- name: Put cargo binary directory into path
53-
run: echo "~/cargo-bin" >> $GITHUB_PATH
46+
cargo install svdtools --version $SVDTOOLS_VERSION --target-dir deps-target
47+
cargo install svd2rust --version $SVD2RUST_VERSION --target-dir deps-target
48+
cargo install form --version $FORM_VERSION --target-dir deps-target
49+
5450
- name: Deploy SSH key
5551
run: |
5652
mkdir ~/.ssh

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## [Unreleased]
44

5+
* Replace python svd tools with rust alternatives
56
* Updated to svd2rust 0.21
67
* `SVDTOOLS` env value for specifying patching tool
78

0 commit comments

Comments
 (0)