Skip to content

Check Template

Check Template #368

Workflow file for this run

# Use the template to create a new starter teensy4-rs project,
# and make sure it compiles.
name: Check Template
on:
push:
branches: [ master, staging, trying ]
schedule:
# At 15:28 on a Thursday
- cron: "28 15 * * 4"
jobs:
template:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: llvm-tools-preview
target: thumbv7em-none-eabihf
override: true
- name: Install cargo-generate
env:
VERSION: v0.5.1 # Keep this in sync with version in PACKAGE
PACKAGE: cargo-generate-v0.5.1-x86_64-unknown-linux-musl
run: |
curl -LJ https://github.com/ashleygwilliams/cargo-generate/releases/download/${VERSION}/${PACKAGE}.tar.gz | tar xz && \
cp ${PACKAGE}/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