Add rust package embedded-std
with module string
#3675
Workflow file for this run
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
# SPDX-FileCopyrightText: 2022-2024 Google LLC | |
# | |
# SPDX-License-Identifier: Apache-2.0 | |
name: CI | |
# XXX: What we'd really like is run on every pull request / pull request change, | |
# which allows GitHub to cancel runs after (force) pushes. Triggering on | |
# these seems to be broken since January 19th 2023 however. Note that not | |
# everyone likes auto-cancellation so we should probably recognize [no-skip] | |
# commits. | |
on: | |
schedule: | |
# Works out to be approx midnight (CET/CEST) accounting for UTC offset and | |
# GitHub scheduling. See the comment at 'branches-ignore' for more | |
# information on our development flow. This job will run in context of the | |
# branch 'staging'. | |
- cron: '0 19 * * *' | |
push: | |
branches-ignore: | |
# Developers request to merge their changes into 'staging'. In order to | |
# do so, relatively cheap tests should pass CI. Every night, CI runs our | |
# full test suite on 'staging'. If these pass, a pull request may be | |
# created to get 'main' up to date with 'staging'. Note that this should | |
# be automated in the future, but this will require some engineering. | |
- 'staging' | |
- 'main' | |
env: | |
# Local machine connected to the bittide demonstrator is called | |
# 'hoeve'. But the docker container of the runner cannot resolve | |
# DNS, so we use its local IP address instead. | |
HW_SERVER_URL: 192.168.102.130:3121 | |
S3_PASSWORD: ${{ secrets.S3_PASSWORD }} | |
SYNTHESIS_BOARD: xilinx.com:kcu105:part0:1.7 | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
license-year: | |
name: License year check | |
runs-on: [self-hosted, compute] | |
defaults: | |
run: | |
shell: git-nix-shell {0} --pure --keep "GITHUB_SHA" --keep "S3_PASSWORD" | |
container: | |
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30 | |
options: --memory=11g | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
# Check needs access to all branches | |
fetch-depth: 0 | |
- name: Check license year of all files per commit | |
run: | | |
# XXX: We want to pass in the target branch of the PR, but we only run | |
# on 'push' (see 'on' section in this YAML). Because of this, GH | |
# sets the target branch to an empty string. | |
.github/scripts/check_copyright_years.py origin/staging | |
license-check: | |
runs-on: [self-hosted, compute] | |
container: | |
image: ubuntu:22.04 | |
options: --memory=11g | |
steps: | |
- uses: actions/checkout@v4 | |
- name: REUSE Compliance Check | |
uses: fsfe/reuse-action@v1 | |
lint: | |
name: Basic linting | |
runs-on: [self-hosted, compute] | |
container: | |
image: ubuntu:22.04 | |
options: --memory=11g | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
.github/scripts/set_de_mirror.sh | |
apt-get update | |
apt-get install -y pcregrep python3-yaml | |
- name: EOL whitespace | |
run: | | |
.github/scripts/check_eol_whitespace.sh | |
- name: Enforce EOF newline | |
run: | | |
.github/scripts/check_missing_eof_newline.sh | |
- name: Check that all self-hosted jobs run in a docker container | |
run: | | |
.github/scripts/self_hosted_docker_check.py | |
- name: Check that the 'all' job depends on all other jobs | |
run: | | |
.github/scripts/all_check.py | |
build: | |
name: Build dependencies | |
runs-on: [self-hosted, compute] | |
defaults: | |
run: | |
shell: git-nix-shell {0} --pure --keep "GITHUB_SHA" --keep "S3_PASSWORD" | |
container: | |
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30 | |
options: --memory=11g | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set CI flags | |
run: | | |
cp .github/cabal.project cabal.project.local | |
- run: cache clean | |
- run: cache pull cabal --missing-ok --write-cache-found | |
- run: cache pull cargo --missing-ok | |
- name: Update Cabal index info | |
run: | | |
if [[ $(cat cache_found) == 0 ]]; then | |
cabal update | |
else | |
echo "Restored cache, no need to update cabal package list" | |
fi | |
- run: ./cargo.sh fetch | |
- run: ./cargo.sh build --frozen --release | |
- run: ./cargo.sh build --frozen | |
- run: cabal build all | |
- run: cache push cabal | |
- run: cache push cargo | |
- run: cache push build | |
elastic-buffer-sim-topologies-matrix: | |
name: elastic-buffer-sim-topologies simulation matrix generation | |
runs-on: [self-hosted, compute] | |
defaults: | |
run: | |
shell: git-nix-shell {0} --pure --keep "GITHUB_OUTPUT" | |
container: | |
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30 | |
options: --memory=11g | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Generate matrix | |
run: | | |
if [[ "${{ github.event_name }}" == "schedule" || $(.github/scripts/force_expensive_checks.sh) == "true" ]]; then | |
cp .github/simulation/all.json sim.json | |
else | |
cp .github/simulation/staging.json sim.json | |
fi | |
- name: Set simulation matrix | |
id: set-sim-matrix | |
run: | | |
echo "sim_matrix=$(cat sim.json | jq -c)" | tee -a "$GITHUB_OUTPUT" | |
echo "artifact_names=$(cat sim.json | jq -c '["gen-plots-hs-" + .[].topology]')" | tee -a "$GITHUB_OUTPUT" | |
outputs: | |
sim_matrix: ${{ steps.set-sim-matrix.outputs.sim_matrix }} | |
artifact_names: ${{ steps.set-sim-matrix.outputs.artifact_names }} | |
elastic-buffer-sim-topologies: | |
name: Simulate network | |
runs-on: [self-hosted, compute] | |
timeout-minutes: 1200 | |
defaults: | |
run: | |
shell: git-nix-shell {0} --pure --keep "GITHUB_SHA" --keep "S3_PASSWORD" | |
needs: [build, lint, elastic-buffer-sim-topologies-matrix] | |
strategy: | |
matrix: | |
target: ${{ fromJson(needs.elastic-buffer-sim-topologies-matrix.outputs.sim_matrix) }} | |
fail-fast: false | |
container: | |
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30 | |
options: --memory=11g | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set CI flags | |
run: | | |
cp .github/cabal.project cabal.project.local | |
- run: cache pull cabal | |
- run: cache pull build | |
- name: Plot mesh grid | |
run: | | |
cabal run -- elastic-buffer-sim:sim \ | |
+RTS -M${{ matrix.target.hmem }}M -RTS \ | |
--output-mode pdf \ | |
--get-rusty \ | |
--steps ${{ matrix.target.steps }} \ | |
--samples 1000 \ | |
--max-startup-offset 2000 \ | |
--stop-after-stable ${{ matrix.target.steps }} \ | |
${{ matrix.target.topology }} ${{ matrix.target.args }} | |
- name: Generate report | |
if: ${{ !cancelled() }} | |
run: | | |
sed -i -e "s/n\([0-9]*\)/\1/g" _build/topology.gv | |
dot2tex \ | |
-f tikz \ | |
--figonly \ | |
--progoptions "-K neato" \ | |
--nodeoptions "every node/.style={fill,text=white,font=\Large\tt,minimum size=2em,inner sep=0pt}" \ | |
--edgeoptions "line width=0.3em" \ | |
_build/topology.gv > _build/topology.tikz | |
cp .github/simulation/report-template.tex _build/report.tex | |
export RUNREF="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
echo "$(date +'%Y-%m-%d %H:%M:%S')" > _build/datetime | |
echo "\\textit{\\href{$RUNREF}{$RUNREF}}" > _build/runref | |
cd _build | |
lualatex report.tex | |
rm -Rf report.{aux,log,out,tex} runref datetime topology.tikz | |
- name: Upload plots | |
uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: gen-plots-hs-${{ matrix.target.topology }} | |
path: | | |
_build | |
!_build/cargo | |
retention-days: 14 | |
generate-full-clock-control-simulation-report: | |
name: Generate clock control simulation report | |
runs-on: [self-hosted, compute] | |
if: ${{ !cancelled() }} | |
defaults: | |
run: | |
shell: git-nix-shell {0} --pure --keep "GITHUB_SHA" --keep "S3_PASSWORD" | |
needs: [build, lint, elastic-buffer-sim-topologies-matrix, elastic-buffer-sim-topologies, bittide-instances-hardware-in-the-loop] | |
container: | |
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30 | |
options: --memory=11g | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set CI flags | |
run: | | |
cp .github/cabal.project cabal.project.local | |
- run: cache pull cabal | |
- run: cache pull cargo | |
- run: cache pull build | |
- name: Download simulation artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
# Note that all artifacts are downloaded, if no 'name' is specified. | |
# Unfortunately, this is the only working solution that github offers | |
# right at the moment. Alternative options exist, like | |
# https://github.com/marketplace/actions/download-multiple-workflow-artifacts, | |
# but this action is currently broken. Once a working solution | |
# is available again, 'artifact_names' from | |
# 'elastic-buffer-sim-topologies-matrix' can be used to only download | |
# the required artifacts instead. | |
path: artifacts | |
- name: Generate HITL based plots | |
run: | | |
mkdir -p reports | |
mkdir -p hitl-plots/hw | |
./cargo.sh build --frozen --release | |
cabal run -- elastic-buffer-sim:plot artifacts/_build-fullMeshHwCcTest-debug/Bittide.Instances.Hitl.FullMeshHwCc.fullMeshHwCcTest/ila-data/probe_test_start/ hitl-plots/hw | |
cp .github/hitl/FullMeshHwCcReportTemplate.tex hitl-plots/hw/report.tex | |
cp .github/hitl/topology.tikz hitl-plots/hw/topology.tikz | |
export RUNREF="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
echo "$(date +'%Y-%m-%d %H:%M:%S')" > hitl-plots/hw/datetime | |
echo "\\textit{\\href{$RUNREF}{$RUNREF}}" > hitl-plots/hw/runref | |
cd hitl-plots/hw | |
lualatex report.tex | |
rm -Rf report.{aux,log,out,tex} topology.tikz | |
cd ../.. | |
mv hitl-plots/hw/report.pdf reports/HITL-FullMeshHwCc-Report.pdf | |
mkdir -p hitl-plots/sw | |
cabal run -- elastic-buffer-sim:plot artifacts/_build-fullMeshSwCcTest-debug/Bittide.Instances.Hitl.FullMeshSwCc.fullMeshSwCcTest/ila-data/probe_test_start/ hitl-plots/sw | |
cp .github/hitl/FullMeshSwCcReportTemplate.tex hitl-plots/sw/report.tex | |
cp .github/hitl/topology.tikz hitl-plots/sw/topology.tikz | |
mv hitl-plots/hw/datetime hitl-plots/sw/datetime | |
mv hitl-plots/hw/runref hitl-plots/sw/runref | |
cd hitl-plots/sw | |
lualatex report.tex | |
rm -Rf report.{aux,log,out,tex} runref datetime topology.tikz | |
cd ../.. | |
mv hitl-plots/sw/report.pdf reports/HITL-FullMeshSwCc-Report.pdf | |
- name: Generate final simulation report | |
run: | | |
set +f # Enable globbing | |
mkdir -p reports | |
pdfunite artifacts/*/report.pdf reports/Simulation-Report.pdf | |
- name: Upload Reports | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Clock Control Reports | |
path: reports | |
retention-days: 14 | |
elastic-buffer-sim-tests: | |
name: elastic-buffer-sim unittests | |
runs-on: [self-hosted, compute] | |
defaults: | |
run: | |
shell: git-nix-shell {0} --pure --keep "GITHUB_SHA" --keep "S3_PASSWORD" | |
needs: [build, lint] | |
container: | |
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30 | |
options: --memory=11g | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set CI flags | |
run: | | |
cp .github/cabal.project cabal.project.local | |
- run: cache pull cabal | |
- run: cache pull build | |
- name: Run unittests | |
run: | | |
cabal run elastic-buffer-sim:unittests | |
bittide-tests: | |
name: Bittide tests | |
runs-on: [self-hosted, compute] | |
defaults: | |
run: | |
shell: git-nix-shell {0} --pure --keep "GITHUB_SHA" --keep "S3_PASSWORD" | |
needs: [build, lint] | |
container: | |
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30 | |
options: --memory=11g | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set CI flags | |
run: | | |
cp .github/cabal.project cabal.project.local | |
- run: cache pull cabal | |
- run: cache pull build | |
- name: Unittests | |
run: | | |
# While Hedgehog can fill many cores with "work", it doesn't actually | |
# speed up the tests. | |
cabal run -- bittide:unittests -j 1 +RTS -N2 | |
- name: Bittide Doctests | |
run: | | |
cabal run -- bittide:doctests | |
- name: Bittide.Extra Doctests | |
run: | | |
cabal run -- bittide-extra:doctests | |
rust-lints: | |
name: Rust Lints | |
runs-on: [self-hosted, compute] | |
defaults: | |
run: | |
shell: git-nix-shell {0} --pure --keep "GITHUB_SHA" --keep "S3_PASSWORD" | |
container: | |
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30 | |
options: --memory=11g | |
needs: [build] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- run: cache pull cargo | |
- name: Rust formatting | |
run: | | |
./cargo.sh fmt --all -- --check | |
- name: Clippy check | |
run: | | |
./cargo.sh clippy --all-features -- -Dwarnings | |
firmware-support-tests: | |
name: Firmware Support Unit Tests | |
runs-on: [self-hosted, compute] | |
defaults: | |
run: | |
shell: git-nix-shell {0} --pure --keep "GITHUB_SHA" --keep "S3_PASSWORD" | |
container: | |
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30 | |
options: --memory=11g | |
needs: [build] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set CI flags | |
run: | | |
cp .github/cabal.project cabal.project.local | |
- run: cache pull cabal | |
- run: cache pull cargo | |
- run: cache pull build | |
- name: Running Tests | |
run: | | |
cargo test --all | |
working-directory: firmware-support/ | |
host-tools-tests: | |
name: Host Tools Unit Tests | |
runs-on: [self-hosted, compute] | |
defaults: | |
run: | |
shell: git-nix-shell {0} --pure --keep "GITHUB_SHA" --keep "S3_PASSWORD" | |
container: | |
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30 | |
options: --memory=11g | |
needs: [build] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set CI flags | |
run: | | |
cp .github/cabal.project cabal.project.local | |
- run: cache pull cargo | |
- name: Running Tests | |
run: | | |
cargo test --all | |
working-directory: host-tools/ | |
firmware-limit-checks: | |
name: Firmware Limit Checks | |
runs-on: [self-hosted, compute] | |
defaults: | |
run: | |
shell: git-nix-shell {0} --pure --keep "GITHUB_SHA" --keep "S3_PASSWORD" | |
container: | |
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30 | |
options: --memory=11g | |
needs: [build] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- run: cache pull cargo | |
- run: cache pull build | |
- name: Install `elf-limits` | |
run: cargo install --locked --git https://github.com/cuddlefishie/elf-limits | |
- name: Checking firmware binary limits | |
run: | | |
~/.cargo/bin/elf-limits \ | |
--instruction-mem-limit 64K \ | |
--data-mem-limit 64K \ | |
clock-control \ | |
hello \ | |
processing-element-test | |
working-directory: _build/cargo/firmware-binaries/riscv32imc-unknown-none-elf/release/ | |
bittide-instances-doctests: | |
name: bittide-instances doctests | |
runs-on: [self-hosted, compute] | |
defaults: | |
run: | |
shell: git-nix-shell {0} --pure --keep "GITHUB_SHA" --keep "S3_PASSWORD" | |
needs: [build, lint] | |
container: | |
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30 | |
options: --memory=11g | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set CI flags | |
run: | | |
cp .github/cabal.project cabal.project.local | |
- run: cache pull cabal | |
- run: cache pull build | |
- name: Doctests | |
run : | | |
cabal run -- bittide-instances:doctests | |
bittide-instances-unittests: | |
name: bittide-instances unittests | |
runs-on: [self-hosted, compute] | |
defaults: | |
run: | |
shell: git-nix-shell {0} --pure --keep "GITHUB_SHA" --keep "S3_PASSWORD" | |
needs: [build, lint] | |
container: | |
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30 | |
options: --memory=11g | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set CI flags | |
run: | | |
cp .github/cabal.project cabal.project.local | |
- run: cache pull cabal | |
- run: cache pull build | |
- name: Unit tests | |
run : | | |
cabal run -- bittide-instances:unittests | |
bittide-instances-hdl-matrix: | |
name: bittide-instances synthesis matrix generation | |
runs-on: [self-hosted, compute] | |
defaults: | |
run: | |
shell: git-nix-shell {0} --pure --keep "GITHUB_OUTPUT" | |
container: | |
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30 | |
options: --memory=11g | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Generate matrix | |
run: | | |
if [[ "${{ github.event_name }}" == "schedule" || $(.github/scripts/force_expensive_checks.sh) == "true" ]]; then | |
cp .github/synthesis/all.json checks.json | |
elif [[ -f .github/synthesis/debug.json ]]; then | |
cp .github/synthesis/debug.json checks.json | |
else | |
cp .github/synthesis/staging.json checks.json | |
fi | |
- name: Set test matrix | |
id: set-matrix | |
run: | | |
echo "check_matrix=$(cat checks.json | tr '\n' ' ')" | tee -a "$GITHUB_OUTPUT" | |
outputs: | |
check_matrix: ${{ steps.set-matrix.outputs.check_matrix }} | |
bittide-instances-hardware-in-the-loop-test-matrix: | |
name: bittide-instances hardware-in-the-loop test matrix generation | |
runs-on: [self-hosted, compute] | |
defaults: | |
run: | |
shell: git-nix-shell {0} --pure --keep "GITHUB_OUTPUT" | |
container: | |
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30 | |
options: --memory=11g | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Generate matrix | |
run: | | |
if [[ "${{ github.event_name }}" == "schedule" || $(.github/scripts/force_expensive_checks.sh) == "true" ]]; then | |
cp .github/synthesis/all.json checks.json | |
elif [[ -f .github/synthesis/debug.json ]]; then | |
cp .github/synthesis/debug.json checks.json | |
else | |
cp .github/synthesis/staging.json checks.json | |
fi | |
jq '[.[] | select(.stage=="test")]' checks.json > checks.json.filtered | |
cp checks.json.filtered checks.json | |
- name: Set test matrix | |
id: set-matrix | |
run: | | |
echo "check_matrix=$(cat checks.json | tr '\n' ' ')" | tee -a "$GITHUB_OUTPUT" | |
outputs: | |
check_matrix: ${{ steps.set-matrix.outputs.check_matrix }} | |
bittide-instances-hdl: | |
name: synth | |
runs-on: [self-hosted, compute] | |
defaults: | |
run: | |
# We leave out '--pure', as 'with_vivado.sh' relies on basic Ubuntu | |
shell: git-nix-shell {0} | |
needs: [build, lint, bittide-instances-hdl-matrix] | |
strategy: | |
matrix: | |
target: ${{ fromJson(needs.bittide-instances-hdl-matrix.outputs.check_matrix) }} | |
fail-fast: false | |
container: | |
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30 | |
volumes: | |
- /opt/tools:/opt/tools | |
options: --init --mac-address="6c:5a:b0:6c:13:0b" --memory=11g | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set CI flags | |
run: | | |
# We use the same flags as the 'build' step to reuse caches. This | |
# "simulation" config only sets altopts on the Risc core, which we | |
# don't synthesize yet. | |
# | |
# TODO: Either switch to VexRisc or update cache strategy. | |
# | |
cp .github/cabal.project cabal.project.local | |
- run: cache pull cabal | |
- run: cache pull cargo | |
- run: cache pull build | |
- name: HDL generation and synthesis | |
run : | | |
target="${{ matrix.target.stage }}" | |
if [[ "${target}" == "program" ]]; then | |
echo "Illegal Shake target on CI: program" | |
exit 1 | |
fi | |
# Only the local runner connected to the bittide demonstrator (hoeve) | |
# should perform the jobs which need hardware access. And that runner | |
# should do only that, so we let other 'compute' runners do the | |
# bitstream generation. | |
if [[ "${target}" == "test" ]]; then | |
target="bitstream" | |
fi | |
.github/scripts/with_vivado.sh \ | |
shake ${{ matrix.target.top }}:"${target}" | |
- name: Archive build artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: _build-${{ matrix.target.top }} | |
# We don't pack `ip`, as it is generally useless for debugging while | |
# also taking up a lot of space. | |
path: | | |
_build/clash | |
_build/vivado | |
_build/.shake.database | |
_build/.shake.lock | |
!_build/vivado/*/ip | |
retention-days: 14 | |
bittide-instances-hardware-in-the-loop: | |
name: HITL | |
runs-on: [self-hosted, hardware-access] | |
defaults: | |
run: | |
# We leave out '--pure', as 'with_vivado.sh' relies on basic Ubuntu | |
shell: git-nix-shell {0} | |
needs: [bittide-instances-hdl, bittide-instances-hardware-in-the-loop-test-matrix] | |
strategy: | |
matrix: | |
target: ${{ fromJson(needs.bittide-instances-hardware-in-the-loop-test-matrix.outputs.check_matrix) }} | |
fail-fast: false | |
container: | |
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30 | |
volumes: | |
- /opt/tools:/opt/tools | |
options: --memory=11g | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set CI flags | |
run: | | |
cp .github/cabal.project cabal.project.local | |
- name: Download artifact _build directory | |
uses: actions/download-artifact@v4 | |
with: | |
name: _build-${{ matrix.target.top }} | |
path: _build | |
- run: cache pull cabal | |
- run: cache pull cargo | |
- run: cache pull build | |
- name: Run tests on hardware | |
run : | | |
.github/scripts/with_vivado.sh \ | |
shake ${{ matrix.target.top }}:test --hardware-targets="${{ matrix.target.targets}}" | |
- name: Archive ILA data | |
if: ${{ !cancelled() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: _build-${{ matrix.target.top }}-debug | |
path: | | |
_build/vivado/*/ila-data | |
retention-days: 14 | |
all: | |
name: All jobs finished | |
if: ${{ !cancelled() }} | |
needs: [ | |
bittide-instances-doctests, | |
bittide-instances-hardware-in-the-loop-test-matrix, | |
bittide-instances-hardware-in-the-loop, | |
bittide-instances-hdl-matrix, | |
bittide-instances-hdl, | |
bittide-instances-unittests, | |
bittide-tests, | |
build, | |
elastic-buffer-sim-tests, | |
elastic-buffer-sim-topologies-matrix, | |
elastic-buffer-sim-topologies, | |
firmware-limit-checks, | |
firmware-support-tests, | |
generate-full-clock-control-simulation-report, | |
host-tools-tests, | |
license-check, | |
license-year, | |
lint, | |
rust-lints, | |
] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Check dependencies for failures | |
run: | | |
# Test all dependencies for success/failure | |
set -x | |
success="${{ contains(needs.*.result, 'success') }}" | |
fail="${{ contains(needs.*.result, 'failure') }}" | |
set +x | |
# Test whether success/fail variables contain sane values | |
if [[ "${success}" != "true" && "${success}" != "false" ]]; then exit 1; fi | |
if [[ "${fail}" != "true" && "${fail}" != "false" ]]; then exit 1; fi | |
# If this is a debug run, fail even when all dependencies succeeded. | |
if [[ -f .github/synthesis/debug.json ]]; then | |
echo "This is a debug run, which may never succeed. Remove '.github/synthesis/debug.json' before trying to merge." | |
exit 1 | |
fi | |
# We want to fail if one or more dependencies fail. For safety, we introduce | |
# a second check: if no dependencies succeeded something weird is going on. | |
if [[ "${fail}" == "true" || "${success}" == "false" ]]; then | |
echo "One or more dependency failed, or no dependency succeeded." | |
exit 1 | |
fi |