Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
burrbull committed Feb 11, 2022
1 parent 5c221ac commit 204839b
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 28 deletions.
62 changes: 36 additions & 26 deletions .github/workflows/ci.yaml
Expand Up @@ -6,9 +6,33 @@ on:
pull_request:

jobs:
install-deps:
name: Install svdtools & svd2rust
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: rustfmt

- name: Cache dependencies
uses: Swatinem/rust-cache@v1
with:
sharedKey: prebuilded

- name: Self install
run: |
cargo install svdtools --version 0.2.0
cargo install svd2rust --version 0.21.0
check:
name: Check
runs-on: ubuntu-latest
needs: [install-deps]
strategy:
matrix:
crate:
Expand All @@ -28,51 +52,37 @@ jobs:
- stm32mp1
- stm32wl
- stm32wb

env:
CRATES: ${{ matrix.crate }}
CARGO_INCREMENTAL: 0
SVDTOOLS: svdtools

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: rustfmt
- name: Install xmllint
run: sudo apt-get install libxml2-utils
- name: Install Python dependencies
run: |
pip3 install --user setuptools wheel
pip3 install --user svdtools
- name: Put pip binary directory into path
run: echo "~/.local/bin" >> $GITHUB_PATH
- name: Cache Cargo installed binaries
uses: actions/cache@v1
id: cache-cargo
with:
path: ~/cargo-bin
key: ${{ runner.os }}-svd2rust-0.21.0
- name: Install svd2rust
if: steps.cache-cargo.outputs.cache-hit != 'true'
uses: actions-rs/install@v0.1

- name: Cache
uses: Swatinem/rust-cache@v1
with:
crate: svd2rust
version: 0.21.0
- name: Copy svd2rust to cache directory
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: |
mkdir ~/cargo-bin
cp ~/.cargo/bin/svd2rust ~/cargo-bin
- name: Put new cargo binary directory into path
run: echo "~/cargo-bin" >> $GITHUB_PATH
sharedKey: prebuilded

- name: Patch SVDs
run: make -j2 patch

- name: Check SVDs
run: make lint

- name: Build PACs
run: make -j2 svd2rust

- name: Check PACs
run: make -j2 check
6 changes: 5 additions & 1 deletion .github/workflows/mmaps_master.yaml
Expand Up @@ -9,6 +9,10 @@ jobs:
build:
name: Build mmaps
runs-on: ubuntu-18.04

env:
SVDTOOLS: svdtools

steps:
- name: Checkout stm32-rs
uses: actions/checkout@v2
Expand All @@ -33,7 +37,7 @@ jobs:
run: |
cd stm32-rs
COMMIT=$(git rev-parse HEAD)
SVDTOOLS=svdtools make -j2 mmaps
make -j2 mmaps
mv mmaps/* ../stm32-rs-mmaps/
cd ../stm32-rs-mmaps
git config user.name "stm32-rs builder"
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/mmaps_pr.yaml
Expand Up @@ -8,6 +8,10 @@ jobs:
name: Compare mmaps
runs-on: ubuntu-18.04
continue-on-error: true

env:
SVDTOOLS: svdtools

steps:
- name: Checkout master
uses: actions/checkout@v2
Expand Down Expand Up @@ -46,7 +50,7 @@ jobs:
cd ../master
rm -rf devices peripherals
mv ../pr/devices ../pr/peripherals .
SVDTOOLS=svdtools make -j2 mmaps
make -j2 mmaps
# Use the new mmaps to make a commit in the mmaps repo
mv mmaps/* ../mmaps/
Expand Down

0 comments on commit 204839b

Please sign in to comment.