Check Template #431
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use the template to create a new starter teensy4-rs project, | |
# and make sure it compiles. | |
name: Check Template | |
on: | |
push: | |
branches: [ master, trying ] | |
schedule: | |
# At 15:28 on a Thursday | |
- cron: "28 15 * * 4" | |
jobs: | |
template: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install toolchain | |
run: rustup toolchain install stable --no-self-update --profile minimal --target thumbv7em-none-eabihf | |
- name: Install cargo-generate | |
env: | |
VERSION: v0.21.0 # Keep this in sync with version in PACKAGE | |
PACKAGE: cargo-generate-v0.21.0-x86_64-unknown-linux-musl | |
run: | | |
curl -LJ https://github.com/cargo-generate/cargo-generate/releases/download/${VERSION}/${PACKAGE}.tar.gz | tar xz && \ | |
ls -al && \ | |
cp cargo-generate $(dirname $(which cargo)) && \ | |
cargo generate --help | |
- name: Generate the template | |
run: cargo generate --git https://github.com/mciantyre/teensy4-rs-template --name krate --branch ci | |
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions | |
- name: Extract branch name | |
shell: bash | |
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
id: extract_branch | |
- name: Update template to target integration branch | |
run: sed -i "s/branch = \"master\"/branch = \"${{ steps.extract_branch.outputs.branch }}\"/g" krate/Cargo.toml | |
- name: Check the template | |
run: cd krate && cargo build |