From e2fedbca6393b52a721c46527f36d11df402e56d Mon Sep 17 00:00:00 2001 From: Brad Campbell Date: Mon, 1 Apr 2024 22:55:28 -0400 Subject: [PATCH] CI: synchronize with makefile This updates the ci.yml workflow to match the Makefile. Some jobs were in different places in each file. This also adds a note that the CI rules do not use the ci-runner* targets. --- .github/workflows/ci.yml | 63 ++++++++++++++++++++++------------------ Makefile | 51 ++++++++++++++++++-------------- 2 files changed, 65 insertions(+), 49 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bdd1915e5f..6732130e97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 OR MIT # Copyright Tock Contributors 2023. -# This workflow contains all tock-ci, seperated into jobs +# This workflow contains all tock-ci, separated into jobs name: tock-ci env: @@ -34,10 +34,12 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 - - name: ci-job-format + - name: ci-job-format run: make ci-job-format - - name: ci-markdown-toc - run: make ci-job-markdown-toc + - name: ci-job-markdown-toc + run: make ci-job-markdown-toc + - name: ci-job-readme-check + run: make ci-job-readme-check ci-clippy: strategy: @@ -49,7 +51,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: - uses: actions/checkout@v3 - - name: ci-job-clippy + - name: ci-job-clippy run: make ci-job-clippy ci-build: @@ -60,16 +62,14 @@ jobs: steps: - uses: actions/checkout@v3 - - - name: ci-job-syntax - run: make ci-job-syntax - - name: ci-job-compilation - run: make ci-job-compilation - - name: ci-job-debug-support-targets - run: make ci-job-debug-support-targets - - - name: ci-job-collect-artifacts - run: make ci-job-collect-artifacts + - name: ci-job-syntax + run: make ci-job-syntax + - name: ci-job-compilation + run: make ci-job-compilation + - name: ci-job-debug-support-targets + run: make ci-job-debug-support-targets + - name: ci-job-collect-artifacts + run: make ci-job-collect-artifacts - name: upload-build-artifacts uses: actions/upload-artifact@v3 with: @@ -92,19 +92,26 @@ jobs: sudo apt install libudev-dev libzmq3-dev if: matrix.os == 'ubuntu-latest' - uses: actions/checkout@v3 - - name: ci-job-libraries - run: make ci-job-libraries - - name: ci-job-archs - run: make ci-job-archs - - name: ci-job-kernel - run: make ci-job-kernel - - name: ci-job-chips - run: make ci-job-chips - - name: ci-job-tools - run: make ci-job-tools + - name: ci-job-libraries + run: make ci-job-libraries + - name: ci-job-archs + run: make ci-job-archs + - name: ci-job-kernel + run: make ci-job-kernel + - name: ci-job-capsules + run: make ci-job-capsules + - name: ci-job-chips + run: make ci-job-chips + - name: ci-job-tools + run: make ci-job-tools + - name: ci-job-cargo-test-build + run: make ci-job-cargo-test-build ci-qemu: - runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} steps: - name: Update package repositories @@ -115,5 +122,5 @@ jobs: run: | sudo apt install meson - uses: actions/checkout@v3 - - name: ci-job-qemu - run: make ci-job-qemu + - name: ci-job-qemu + run: make ci-job-qemu diff --git a/Makefile b/Makefile index 3659f1a484..8e85a32f9f 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ ################################################################################ ## -## Interal support that needs to run first +## Internal support that needs to run first ## # First, need to fill out some variables that the Makefile will use @@ -274,12 +274,14 @@ ci: ci-help ## These each correspond to a 'status check' line in GitHub PR UX. ## ## These recipes *must not* contain rules, they simply collect jobs. - -# n.b. This *replicates* configuration in the github workflow file -# to allow the GitHub UX to show these subtasks correctly +## +## NOTE: If you modify these, you must also modify the ci.yml CI workflow file +## in `.github/workflows`. This *replicates* configuration in the github +## workflow file to allow the GitHub UX to show these subtasks correctly. .PHONY: ci-runner-github ci-runner-github:\ ci-runner-github-format\ + ci-runner-github-clippy\ ci-runner-github-build\ ci-runner-github-tests\ ci-runner-github-qemu @@ -288,18 +290,21 @@ ci-runner-github:\ .PHONY: ci-runner-github-format ci-runner-github-format:\ ci-job-format\ - ci-job-clippy\ ci-job-markdown-toc\ ci-job-readme-check $(call banner,CI-Runner: GitHub format runner DONE) +.PHONY: ci-runner-github-clippy +ci-runner-github-clippy:\ + ci-job-clippy + $(call banner,CI-Runner: GitHub clippy runner DONE) + .PHONY: ci-runner-github-build ci-runner-github-build:\ ci-job-syntax\ ci-job-compilation\ ci-job-debug-support-targets\ - ci-job-collect-artifacts\ - ci-job-cargo-test-build + ci-job-collect-artifacts $(call banner,CI-Runner: GitHub build runner DONE) .PHONY: ci-runner-github-tests @@ -310,7 +315,8 @@ ci-runner-github-tests:\ ci-job-capsules\ ci-job-chips\ ci-job-tools\ - ci-job-miri + ci-job-cargo-test-build\ + ci-job-miri # EXPERIMENTAL $(call banner,CI-Runner: GitHub tests runner DONE) .PHONY: ci-runner-github-qemu @@ -348,11 +354,6 @@ ci-job-format: licensecheck $(call banner,CI-Job: Format Check) @NOWARNINGS=true TOCK_FORMAT_MODE=diff $(MAKE) format -.PHONY: ci-job-clippy -ci-job-clippy: - $(call banner,CI-Job: Clippy) - @NOWARNINGS=true ./tools/run_clippy.sh - define ci_setup_markdown_toc $(call banner,CI-Setup: Install markdown-toc) npm install markdown-toc @@ -388,6 +389,14 @@ ci-job-readme-check: +### ci-runner-github-clippy jobs: +.PHONY: ci-job-clippy +ci-job-clippy: + $(call banner,CI-Job: Clippy) + @NOWARNINGS=true ./tools/run_clippy.sh + + + ### ci-runner-github-build jobs: .PHONY: ci-job-syntax ci-job-syntax: @@ -524,8 +533,9 @@ ci-job-cargo-test-build: @$(MAKE) NO_RUN="--no-run" -C "boards/opentitan/earlgrey-cw310" test @$(MAKE) NO_RUN="--no-run" -C "boards/esp32-c3-devkitM-1" test -### ci-runner-github-qemu jobs: + +### ci-runner-github-qemu jobs: QEMU_COMMIT_HASH=1600b9f46b1bd08b00fe86c46ef6dbb48cbe10d6 define ci_setup_qemu_riscv $(call banner,CI-Setup: Build QEMU) @@ -547,8 +557,6 @@ ci-setup-qemu: CI_JOB_QEMU_RISCV) $(if $(CI_JOB_QEMU_RISCV),$(eval CI_JOB_QEMU := true)) - - define ci_job_qemu $(call banner,CI-Job: QEMU) @cd tools/qemu-runner;\ @@ -563,10 +571,6 @@ endef ci-job-qemu: ci-setup-qemu $(if $(CI_JOB_QEMU),$(call ci_job_qemu)) -.PHONY: board-release-test -board-release-test: - @cd tools/board-runner;\ - cargo run ${TARGET} ### ci-runner-netlify jobs: @@ -577,4 +581,9 @@ ci-job-rustdoc: ## End CI rules ## -################################################################### +################################################################################ + +.PHONY: board-release-test +board-release-test: + @cd tools/board-runner;\ + cargo run ${TARGET}