Add better random number functions. #118
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
on: [push, pull_request] | |
name: Build (and Release) | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
name: Build (and Release) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Add targets | |
run: | | |
rustup target add thumbv6m-none-eabi | |
rustup target add thumbv7m-none-eabi | |
rustup target add thumbv7em-none-eabi | |
rustup component add llvm-tools | |
cargo install cargo-binutils | |
- name: Add C tools | |
run: | | |
sudo apt-get -y install gcc-arm-none-eabi binutils-arm-none-eabi | |
- name: Find slug name | |
run: | | |
slug=$(./describe.sh "${GITHUB_REF}") | |
echo "Building with slug '${slug}'" | |
echo "slug=${slug}" >> "${GITHUB_ENV}" | |
- name: Build lib (native) | |
run: | | |
cargo build --verbose | |
- name: Test lib (native) | |
run: | | |
cargo test --verbose | |
- name: Build samples (Cortex-M0+) | |
run: | | |
cd samples | |
./build.sh thumbv6m-none-eabi | |
mv release release-thumbv6m-none-eabi | |
- name: Build samples (Cortex-M3) | |
run: | | |
cd samples | |
./build.sh thumbv7m-none-eabi | |
mv release release-thumbv7m-none-eabi | |
- name: Build samples (Cortex-M4) | |
run: | | |
cd samples | |
./build.sh thumbv7em-none-eabi | |
mv release release-thumbv7em-none-eabi | |
- name: Assemble Artifacts | |
run: | | |
echo "Making ./neotron-sdk-${{ env.slug }}..." | |
mkdir -p ./neotron-sdk-${{ env.slug }}/samples | |
mv ./samples/release-thumbv6m-none-eabi ./neotron-sdk-${{ env.slug }}/samples/thumbv6m-none-eabi | |
mv ./samples/release-thumbv7m-none-eabi ./neotron-sdk-${{ env.slug }}/samples/thumbv7m-none-eabi | |
mv ./samples/release-thumbv7em-none-eabi ./neotron-sdk-${{ env.slug }}/samples/thumbv7em-none-eabi | |
echo "Compressing ./neotron-sdk-${{ env.slug }}.zip..." | |
zip -r ./neotron-sdk-${{ env.slug }}.zip ./neotron-sdk-${{ env.slug }} | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{success()}} | |
with: | |
name: Artifacts | |
if-no-files-found: error | |
path: | | |
./neotron-sdk-*/ | |
- 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: ./neotron-sdk-${{ env.slug }}.zip |