Skip to content

Build

Build #253

Workflow file for this run

on:
push:
pull_request:
schedule:
- cron: 0 1 * * 1
name: Build
env:
RUSTFLAGS: '-D warnings'
# Deactivated building git version until everything (drivers, hals) are migrated to embedded-hal 1.0
DRIVERS: >
apds9960
ds323x
embedded-ccs811
hdc20xx
isl29125
kxcj9
max170xx
max3010x
max44009
mcp4x
mcp49xx
mcp794xx
mlx9061x
mma8x5x
opt300x
pcf857x
tcs3472
veml6030
veml6075
xca9548a
# The Git version of these drivers are not compatible. Deactivated until a new version is released.
# ad983x
# ads1x1x
# bmi160
# ds1307
# eeprom24x
# lm75
# lsm303agr
# pwm-pca9685
# tmp006
# tmp1x2
# veml6040
# veml6070
jobs:
ci-bare-metal:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, beta]
SUBFOLDER:
- stm32f3-discovery
- stm32f1-bluepill
- microbit
VERSION:
- released
# - git # Deactivated building git version until everything (drivers, hals) are migrated to embedded-hal 1.0
include:
- SUBFOLDER: stm32f3-discovery
TARGET: thumbv7em-none-eabihf
- SUBFOLDER: stm32f1-bluepill
TARGET: thumbv7m-none-eabi
- SUBFOLDER: microbit
TARGET: thumbv6m-none-eabi
steps:
- uses: actions/checkout@v4
- name: Cache cargo dependencies
uses: actions/cache@v4
with:
path: |
- ~/.cargo/bin/
- ~/.cargo/registry/index/
- ~/.cargo/registry/cache/
- ~/.cargo/git/db/
key: ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }}
${{ runner.OS }}-cargo-
- name: Cache build output dependencies
uses: actions/cache@v2
with:
path: target
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
${{ runner.OS }}-build-
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.TARGET }}
- name: Checkout CI scripts
uses: actions/checkout@v4
with:
repository: 'eldruin/rust-driver-ci-scripts'
ref: 'master'
path: 'ci'
- run: ../ci/patch-no-std.sh
working-directory: ${{ matrix.SUBFOLDER }}
- run: ../ci/patch-git-drivers.sh
working-directory: ${{ matrix.SUBFOLDER }}
if: contains(matrix.VERSION, 'git')
- name: Build
working-directory: ${{ matrix.SUBFOLDER }}
run: cargo build --target=${{ matrix.TARGET }} --examples --release
ci-rpi:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, beta]
SUBFOLDER:
- raspberrypi
TARGET:
- armv7-unknown-linux-gnueabihf
VERSION:
- released
# - git # Deactivated building git version until everything (drivers, hals) are migrated to embedded-hal 1.0
steps:
- uses: actions/checkout@v4
- name: Cache cargo dependencies
uses: actions/cache@v4
with:
path: |
- ~/.cargo/bin/
- ~/.cargo/registry/index/
- ~/.cargo/registry/cache/
- ~/.cargo/git/db/
key: ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }}
${{ runner.OS }}-cargo-
- name: Cache build output dependencies
uses: actions/cache@v2
with:
path: target
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
${{ runner.OS }}-build-
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.TARGET }}
- run: cargo install cross
- name: Checkout CI scripts
uses: actions/checkout@v4
with:
repository: 'eldruin/rust-driver-ci-scripts'
ref: 'master'
path: 'ci'
- run: ../ci/patch-git-drivers.sh
working-directory: ${{ matrix.SUBFOLDER }}
if: contains(matrix.VERSION, 'git')
- name: Build
working-directory: ${{ matrix.SUBFOLDER }}
run: cross build --target=${{ matrix.TARGET }} --examples