add CI colors, comment on speedups #792
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
name: Build sample material | |
env: | |
CARGO_TERM_COLOR: always # We want colors in our CI output | |
CARGO_INCREMENTAL: 0 # Don't waste time writing out incremental build files | |
CARGO_PROFILE_TEST_DEBUG: 0 # These are thrown away anyways, don't produce them | |
on: | |
push: | |
pull_request: | |
jobs: | |
deploy: | |
runs-on: ubuntu-20.04 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install tools | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: [email protected],[email protected],[email protected],[email protected] | |
# `minimal` profile avoids downloading `rustdocs`, `clippy`, etc. | |
- name: Install targets | |
run: | | |
rustup set profile minimal | |
rustup target add thumbv7em-none-eabihf | |
rustup component add rust-src | |
rustup component add rustfmt | |
- name: Find slug name | |
run: | | |
slug=$(./describe.sh "${GITHUB_REF}") | |
echo "Building with slug '${slug}'" | |
echo "slug=${slug}" >> "${GITHUB_ENV}" | |
- name: Build and test | |
env: # Or as an environment variable | |
HIDDEN_MESSAGE: ${{ secrets.HIDDEN_MESSAGE }} | |
run: | | |
./build.sh "./rust-exercises-${{ env.slug }}" | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{success()}} | |
with: | |
name: Artifacts | |
if-no-files-found: error | |
path: | | |
./rust-exercises-* | |
- name: Create and Upload Release | |
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/') | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "./rust-exercises-${{ env.slug }}.zip,./rust-exercises-${{ env.slug }}/nrf52-code/boards/dongle-fw/*-fw" | |
allowUpdates: true | |
updateOnlyUnreleased: true | |