From eff6b7962851bfd1f8c994b4d821611f456b8b4a Mon Sep 17 00:00:00 2001 From: chrysn Date: Fri, 24 Nov 2023 11:26:04 +0100 Subject: [PATCH 01/19] CI: Run on main and on request in addition to pull requests --- .github/workflows/buildtest.yml | 5 +++-- .github/workflows/rustfmt.yml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index 1a9fb92a..053c791c 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -5,8 +5,9 @@ name: build-test on: pull_request: - branches: - - '*' + push: + branches: [main] + workflow_dispatch: jobs: build-test: diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml index ee484079..cac8241f 100644 --- a/.github/workflows/rustfmt.yml +++ b/.github/workflows/rustfmt.yml @@ -2,8 +2,9 @@ name: rustfmt on: pull_request: - branches: - - '*' + push: + branches: [main] + workflow_dispatch: jobs: rustfmt: From 725d049cef8132659e8d6203c515983c5e90f781 Mon Sep 17 00:00:00 2001 From: chrysn Date: Fri, 24 Nov 2023 11:59:16 +0100 Subject: [PATCH 02/19] CI: Split update and build, run in parallel --- .github/workflows/buildtest.yml | 69 ++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index 053c791c..e316def3 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -10,7 +10,7 @@ on: workflow_dispatch: jobs: - build-test: + prepare: runs-on: ubuntu-latest container: riot/riotbuild steps: @@ -27,46 +27,53 @@ jobs: echo '[patch.crates-io]' >> .cargo/config.toml echo 'riot-wrappers = { path = "../", version = "*" }' >> .cargo/config.toml echo 'riot-sys = { git = "https://github.com/RIOT-OS/rust-riot-sys" }' >> .cargo/config.toml - - name: Build on selected platforms - # not going with a - # - # strategy: - # matrix: - # example: [examples/rust-hello-world examples/rust-gcoap tests/rust_minimal] - # - # setup here because really most of the stuff is the same, and the `cargo - # update` is much faster the second time (so a parallel execution may - # still be faster but uses 3x the resources) + - name: Pull cargo updates + # No sense in running this in parallel -- this will download the index + # and all relevant crates once, and after that, the run: | - export BOARDS='native sltb001a samr21-xpro stk3700' - DIRS='examples/rust-hello-world examples/rust-gcoap tests/rust_minimal' # It appears that there has to be output before :: commands really catch on - echo "Building ${DIRS} on ${BOARDS}" + echo "Pulling updates" echo "::echo ::on" - cd RIOT - for D in ${DIRS}; do - cd ${D} - echo "::group::Building ${D}" - cargo update -p riot-sys -p riot-wrappers --aggressive - cargo tree - make buildtest BUILDTEST_MAKE_REDIRECT='' - cd ../.. - echo "::endgroup::" + for MANIF in $(find RIOT -name Cargo.toml) + do + echo "::group::Updating ${MANIF}" + cargo update -p riot-sys -p riot-wrappers --aggressive --manifest-path $MANIF + cargo fetch --manifest-path $MANIF + cargo tree --manifest-path $MANIF + echo "::endgroup::" done - cd .. - echo "::echo ::off" + + build-examples: + needs: prepare + runs-on: ubuntu-latest + container: riot/riotbuild + strategy: + matrix: + example: [examples/rust-hello-world, examples/rust-gcoap, tests/rust_minimal] + board: [native, sltb001a, samr32-xpro, stk3700] + steps: + - name: Build on selected platforms + run: | + make buildtest BUILDTEST_MAKE_REDIRECT='' BOARD=${{ matrix.board }} -C RIOT/${{ matrix.example }} + + build-tests: + needs: prepare + runs-on: ubuntu-latest + container: riot/riotbuild + strategy: + matrix: + board: [native, sltb001a, samr21-xpro, stk3700] + steps: - name: Build and run tests run: | - export BOARDS='native sltb001a samr21-xpro stk3700' - DIRS=$(echo tests/*/) + DIRS=$(echo RIOT/tests/*/) export RIOTBASE=$(pwd)/RIOT # It appears that there has to be output before :: commands really catch on - echo "Building ${DIRS} on ${BOARDS}" + echo "Building ${DIRS} on ${{ matrix.board }}" echo "::echo ::on" for D in ${DIRS}; do - cd ${D} + pushd ${D} echo "::group::Building ${D}" - cargo update -p riot-sys -p riot-wrappers --aggressive make buildtest BUILDTEST_MAKE_REDIRECT='' echo "::endgroup::" if make test/available BOARD=native; then @@ -74,6 +81,6 @@ jobs: make all test BOARD=native echo "::endgroup::" fi - cd ../.. + popd done echo "::echo ::off" From 224f4858b2f2c7a69ad584f7b711f074be6518b7 Mon Sep 17 00:00:00 2001 From: chrysn Date: Fri, 24 Nov 2023 12:42:41 +0100 Subject: [PATCH 03/19] CI: Run everything in parallel The largest amount of time is the machine checkout -- 2 minutes. The 7 seconds of `cargo update` are dwarved by that, and running in parallel means we don't have to eat those 2 minutes twice. (Also, I couldn't figure out how to carry the output state of the `needs`'d preparations over to the actual working steps). --- .github/workflows/buildtest.yml | 51 +++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index e316def3..b77c8e26 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -10,10 +10,15 @@ on: workflow_dispatch: jobs: - prepare: + build-examples: runs-on: ubuntu-latest container: riot/riotbuild + strategy: + matrix: + example: [examples/rust-hello-world, examples/rust-gcoap, tests/rust_minimal] + board: [native, sltb001a, samr32-xpro, stk3700] steps: + # common steps start here - uses: actions/checkout@v3 - uses: actions/checkout@v3 with: @@ -29,7 +34,7 @@ jobs: echo 'riot-sys = { git = "https://github.com/RIOT-OS/rust-riot-sys" }' >> .cargo/config.toml - name: Pull cargo updates # No sense in running this in parallel -- this will download the index - # and all relevant crates once, and after that, the + # and all relevant crates once, and after that, just make some notes in Cargo.lock run: | # It appears that there has to be output before :: commands really catch on echo "Pulling updates" @@ -42,28 +47,50 @@ jobs: cargo tree --manifest-path $MANIF echo "::endgroup::" done + # common steps end here - build-examples: - needs: prepare - runs-on: ubuntu-latest - container: riot/riotbuild - strategy: - matrix: - example: [examples/rust-hello-world, examples/rust-gcoap, tests/rust_minimal] - board: [native, sltb001a, samr32-xpro, stk3700] - steps: - name: Build on selected platforms run: | make buildtest BUILDTEST_MAKE_REDIRECT='' BOARD=${{ matrix.board }} -C RIOT/${{ matrix.example }} build-tests: - needs: prepare runs-on: ubuntu-latest container: riot/riotbuild strategy: matrix: board: [native, sltb001a, samr21-xpro, stk3700] steps: + # common steps start here + - uses: actions/checkout@v3 + - uses: actions/checkout@v3 + with: + repository: RIOT-OS/RIOT + path: RIOT + - name: Patch .cargo/config.toml to use current checkout + run: | + cd RIOT + rm -f .cargo/config.toml + mkdir -p .cargo # Keep working if RIOT ever decides it doesn't need overrides any more + echo '[patch.crates-io]' >> .cargo/config.toml + echo 'riot-wrappers = { path = "../", version = "*" }' >> .cargo/config.toml + echo 'riot-sys = { git = "https://github.com/RIOT-OS/rust-riot-sys" }' >> .cargo/config.toml + - name: Pull cargo updates + # No sense in running this in parallel -- this will download the index + # and all relevant crates once, and after that, just make some notes in Cargo.lock + run: | + # It appears that there has to be output before :: commands really catch on + echo "Pulling updates" + echo "::echo ::on" + for MANIF in $(find RIOT -name Cargo.toml) + do + echo "::group::Updating ${MANIF}" + cargo update -p riot-sys -p riot-wrappers --aggressive --manifest-path $MANIF + cargo fetch --manifest-path $MANIF + cargo tree --manifest-path $MANIF + echo "::endgroup::" + done + # common steps end here + - name: Build and run tests run: | DIRS=$(echo RIOT/tests/*/) From 6926bd1cb78ba13accb767824ee8f9bfdf26524b Mon Sep 17 00:00:00 2001 From: chrysn Date: Fri, 24 Nov 2023 12:55:02 +0100 Subject: [PATCH 04/19] CI: Fix minor errors --- .github/workflows/buildtest.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index b77c8e26..eae0fc46 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: example: [examples/rust-hello-world, examples/rust-gcoap, tests/rust_minimal] - board: [native, sltb001a, samr32-xpro, stk3700] + board: [native, sltb001a, samr21-xpro, stk3700] steps: # common steps start here - uses: actions/checkout@v3 @@ -99,7 +99,7 @@ jobs: echo "Building ${DIRS} on ${{ matrix.board }}" echo "::echo ::on" for D in ${DIRS}; do - pushd ${D} + cd ${D} echo "::group::Building ${D}" make buildtest BUILDTEST_MAKE_REDIRECT='' echo "::endgroup::" @@ -108,6 +108,6 @@ jobs: make all test BOARD=native echo "::endgroup::" fi - popd + cd - done echo "::echo ::off" From 394a02522f2b73be9718d012a5c414ed37059fcb Mon Sep 17 00:00:00 2001 From: chrysn Date: Fri, 24 Nov 2023 13:35:39 +0100 Subject: [PATCH 05/19] CI: Adjust to not all tests sitting in tests/* any more --- .github/workflows/buildtest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index eae0fc46..a67a47b1 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -93,7 +93,7 @@ jobs: - name: Build and run tests run: | - DIRS=$(echo RIOT/tests/*/) + DIRS=$(find RIOT/tests -name Makefile | xargs -n1 dirname) export RIOTBASE=$(pwd)/RIOT # It appears that there has to be output before :: commands really catch on echo "Building ${DIRS} on ${{ matrix.board }}" From 1a31e0b925ce75fc0c6d1968878940c6564015a9 Mon Sep 17 00:00:00 2001 From: chrysn Date: Fri, 24 Nov 2023 13:42:22 +0100 Subject: [PATCH 06/19] CI fix: Run on the selected board instead of all boards --- .github/workflows/buildtest.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index a67a47b1..b2fe3b15 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -49,9 +49,9 @@ jobs: done # common steps end here - - name: Build on selected platforms + - name: Build the example run: | - make buildtest BUILDTEST_MAKE_REDIRECT='' BOARD=${{ matrix.board }} -C RIOT/${{ matrix.example }} + make all BOARD=${{ matrix.board }} -C RIOT/${{ matrix.example }} build-tests: runs-on: ubuntu-latest @@ -101,9 +101,11 @@ jobs: for D in ${DIRS}; do cd ${D} echo "::group::Building ${D}" - make buildtest BUILDTEST_MAKE_REDIRECT='' + # By running buildtest instead of all, we just skip boards that don't + # satisfy some requirements for some test + make buildtest BUILDTEST_MAKE_REDIRECT='' BOARDS=${{ matrix.board }} echo "::endgroup::" - if make test/available BOARD=native; then + if make test/available BOARD=native && [ "native" = "${{ matrix.board }}" ]; then echo "::group::Testing ${D}" make all test BOARD=native echo "::endgroup::" From 8cdc14eb4ebdedab4144075afa64d18667d3aaf6 Mon Sep 17 00:00:00 2001 From: chrysn Date: Fri, 24 Nov 2023 13:50:49 +0100 Subject: [PATCH 07/19] CI: continue on error in example tests --- .github/workflows/buildtest.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index b2fe3b15..586d9959 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -13,6 +13,8 @@ jobs: build-examples: runs-on: ubuntu-latest container: riot/riotbuild + # Best would be "continue until there are errors from different examples *and* different boards" + continue-on-error: true strategy: matrix: example: [examples/rust-hello-world, examples/rust-gcoap, tests/rust_minimal] From 154222077f5726d8f21482b58d701e3a9cb804b0 Mon Sep 17 00:00:00 2001 From: chrysn Date: Fri, 24 Nov 2023 17:20:03 +0100 Subject: [PATCH 08/19] CI: Fix make invocation error that caused tests to fail when a board lacks their prerequisites --- .github/workflows/buildtest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index 586d9959..7ffe9d99 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -105,7 +105,7 @@ jobs: echo "::group::Building ${D}" # By running buildtest instead of all, we just skip boards that don't # satisfy some requirements for some test - make buildtest BUILDTEST_MAKE_REDIRECT='' BOARDS=${{ matrix.board }} + BOARDS=${{ matrix.board }} make buildtest BUILDTEST_MAKE_REDIRECT='' echo "::endgroup::" if make test/available BOARD=native && [ "native" = "${{ matrix.board }}" ]; then echo "::group::Testing ${D}" From d633e3c812a8bbe6585a4a5d2f04d9c3b343edb5 Mon Sep 17 00:00:00 2001 From: chrysn Date: Fri, 24 Nov 2023 17:46:59 +0100 Subject: [PATCH 09/19] CI: Explicitly check for board support ... because the test running clause would not test on its own and fail on missing feature requirements --- .github/workflows/buildtest.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index 7ffe9d99..1c07ac30 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -101,11 +101,10 @@ jobs: echo "Building ${DIRS} on ${{ matrix.board }}" echo "::echo ::on" for D in ${DIRS}; do - cd ${D} echo "::group::Building ${D}" - # By running buildtest instead of all, we just skip boards that don't - # satisfy some requirements for some test - BOARDS=${{ matrix.board }} make buildtest BUILDTEST_MAKE_REDIRECT='' + cd ${D} + BOARDS=${{ matrix.board }} make info-boards-supported | grep -q . || ( cd -; continue ) + BOARD=${{ matrix.board }} make all echo "::endgroup::" if make test/available BOARD=native && [ "native" = "${{ matrix.board }}" ]; then echo "::group::Testing ${D}" From aaedea9111b7073c4a924136011cfb69ce459a02 Mon Sep 17 00:00:00 2001 From: chrysn Date: Fri, 24 Nov 2023 21:11:53 +0100 Subject: [PATCH 10/19] CI: Overhaul debug output At least with the current GitHub versions, ::echo ::on doesn't do anything. --- .github/workflows/buildtest.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index 1c07ac30..244a3837 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -21,13 +21,16 @@ jobs: board: [native, sltb001a, samr21-xpro, stk3700] steps: # common steps start here - - uses: actions/checkout@v3 - - uses: actions/checkout@v3 + - name: Check out riot-wrappers + uses: actions/checkout@v3 + - name: Check out RIOT + uses: actions/checkout@v3 with: repository: RIOT-OS/RIOT path: RIOT - name: Patch .cargo/config.toml to use current checkout run: | + set -x cd RIOT rm -f .cargo/config.toml mkdir -p .cargo # Keep working if RIOT ever decides it doesn't need overrides any more @@ -38,9 +41,7 @@ jobs: # No sense in running this in parallel -- this will download the index # and all relevant crates once, and after that, just make some notes in Cargo.lock run: | - # It appears that there has to be output before :: commands really catch on - echo "Pulling updates" - echo "::echo ::on" + set -x for MANIF in $(find RIOT -name Cargo.toml) do echo "::group::Updating ${MANIF}" @@ -63,13 +64,16 @@ jobs: board: [native, sltb001a, samr21-xpro, stk3700] steps: # common steps start here - - uses: actions/checkout@v3 - - uses: actions/checkout@v3 + - name: Check out riot-wrappers + uses: actions/checkout@v3 + - name: Check out RIOT + uses: actions/checkout@v3 with: repository: RIOT-OS/RIOT path: RIOT - name: Patch .cargo/config.toml to use current checkout run: | + set -x cd RIOT rm -f .cargo/config.toml mkdir -p .cargo # Keep working if RIOT ever decides it doesn't need overrides any more @@ -80,9 +84,7 @@ jobs: # No sense in running this in parallel -- this will download the index # and all relevant crates once, and after that, just make some notes in Cargo.lock run: | - # It appears that there has to be output before :: commands really catch on - echo "Pulling updates" - echo "::echo ::on" + set -x for MANIF in $(find RIOT -name Cargo.toml) do echo "::group::Updating ${MANIF}" @@ -95,15 +97,13 @@ jobs: - name: Build and run tests run: | + set -x DIRS=$(find RIOT/tests -name Makefile | xargs -n1 dirname) export RIOTBASE=$(pwd)/RIOT - # It appears that there has to be output before :: commands really catch on - echo "Building ${DIRS} on ${{ matrix.board }}" - echo "::echo ::on" for D in ${DIRS}; do echo "::group::Building ${D}" cd ${D} - BOARDS=${{ matrix.board }} make info-boards-supported | grep -q . || ( cd -; continue ) + BOARDS=${{ matrix.board }} make info-boards-supported | grep -q . || ( echo "Board is not supported for this test"; cd -; continue ) BOARD=${{ matrix.board }} make all echo "::endgroup::" if make test/available BOARD=native && [ "native" = "${{ matrix.board }}" ]; then From 0965b3e41f7eb594ddca482ad07b008c4fc4e7f0 Mon Sep 17 00:00:00 2001 From: chrysn Date: Sat, 25 Nov 2023 12:45:38 +0100 Subject: [PATCH 11/19] CI: Avoid fancy sh things that go wrong --- .github/workflows/buildtest.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index 244a3837..f4bbdc89 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -103,14 +103,20 @@ jobs: for D in ${DIRS}; do echo "::group::Building ${D}" cd ${D} - BOARDS=${{ matrix.board }} make info-boards-supported | grep -q . || ( echo "Board is not supported for this test"; cd -; continue ) - BOARD=${{ matrix.board }} make all - echo "::endgroup::" - if make test/available BOARD=native && [ "native" = "${{ matrix.board }}" ]; then - echo "::group::Testing ${D}" - make all test BOARD=native - echo "::endgroup::" + if BOARDS=${{ matrix.board }} make info-boards-supported | grep -q . + then + BOARD=${{ matrix.board }} make all + + if [ "native" = "${{ matrix.board }}" ] && make test/available BOARD=native + then + echo "::group::Testing ${D}" + make all test BOARD=native + echo "::endgroup::" + fi + else + echo "Board is not supported for this test, skipping." fi cd - + echo "::endgroup::" done echo "::echo ::off" From aa5e88990452aff679cd06704af67fe464596f96 Mon Sep 17 00:00:00 2001 From: chrysn Date: Sun, 26 Nov 2023 02:05:03 +0100 Subject: [PATCH 12/19] CI: Replicate a special-casing of RIOT_CI_BUILD (But not enabling RIOT_CI_BUILD b/c we're not inside a Murdock run, and who knows what else that flag enables.) --- .github/workflows/buildtest.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index f4bbdc89..84cfe0c3 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -105,7 +105,17 @@ jobs: cd ${D} if BOARDS=${{ matrix.board }} make info-boards-supported | grep -q . then - BOARD=${{ matrix.board }} make all + # RIOTNOLINK is a workaround for boards with insufficient memory + # showing as supported but still being known not to be buildable. + # Other CI works around by having RIOT_CI_BUILD set RIOTNOLINK if + # the board is known to not have enough memory from + # BOARD_INSUFFICIENT_MEMORY, but that information is not piped out. + # + # Until a better workaround is found, no boards are linked, and if + # a board does exceed its memory due to a Rust change, that will + # only be spotted when the Rust crate is updated in RIOT and a full + # test with the precise criterion is run. + BOARD=${{ matrix.board }} make all RIOTNOLINK=1 if [ "native" = "${{ matrix.board }}" ] && make test/available BOARD=native then From e8c6c6395e937f7fe0886977a10cfeaed4c57543 Mon Sep 17 00:00:00 2001 From: chrysn Date: Sun, 26 Nov 2023 11:27:39 +0100 Subject: [PATCH 13/19] CI: Skip LVGL test which is currently broken Workaround-For: https://github.com/RIOT-OS/RIOT/issues/20110 --- .github/workflows/buildtest.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index 84cfe0c3..58a6baf4 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -98,7 +98,8 @@ jobs: - name: Build and run tests run: | set -x - DIRS=$(find RIOT/tests -name Makefile | xargs -n1 dirname) + # Removing tests/pkg/lvgl due to https://github.com/RIOT-OS/RIOT/issues/20110 + DIRS=$(find RIOT/tests -name Makefile | grep -v tests/pkg/lvgl | xargs -n1 dirname) export RIOTBASE=$(pwd)/RIOT for D in ${DIRS}; do echo "::group::Building ${D}" From 1cef1c743aa4eb6e8e328acfdf47350c1909cdb9 Mon Sep 17 00:00:00 2001 From: chrysn Date: Sun, 26 Nov 2023 12:51:10 +0100 Subject: [PATCH 14/19] CI: Clean after tests to avoid filling up disk --- .github/workflows/buildtest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index 58a6baf4..752ed215 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -124,6 +124,7 @@ jobs: make all test BOARD=native echo "::endgroup::" fi + BOARD=${{ matrix.board }} make clean else echo "Board is not supported for this test, skipping." fi From c7e352fd056e8d10794171d9f9b6b118f1955c40 Mon Sep 17 00:00:00 2001 From: chrysn Date: Fri, 1 Dec 2023 19:14:50 +0100 Subject: [PATCH 15/19] CI: Fix how list of tests is obtained Some Makefile are for tools inside tests --- .github/workflows/buildtest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index 752ed215..7dba0380 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -99,7 +99,7 @@ jobs: run: | set -x # Removing tests/pkg/lvgl due to https://github.com/RIOT-OS/RIOT/issues/20110 - DIRS=$(find RIOT/tests -name Makefile | grep -v tests/pkg/lvgl | xargs -n1 dirname) + DIRS=$(make -f makefiles/app_dirs.inc.mk info-applications | grep -v tests/pkg/lvgl) export RIOTBASE=$(pwd)/RIOT for D in ${DIRS}; do echo "::group::Building ${D}" From 333c18862f5542bf949a37bf6a851646b5d3830d Mon Sep 17 00:00:00 2001 From: chrysn Date: Fri, 1 Dec 2023 19:17:56 +0100 Subject: [PATCH 16/19] CI: Trim list of executed tests --- .github/workflows/buildtest.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index 7dba0380..f2fd0d93 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -98,8 +98,17 @@ jobs: - name: Build and run tests run: | set -x + cd RIOT # Removing tests/pkg/lvgl due to https://github.com/RIOT-OS/RIOT/issues/20110 - DIRS=$(make -f makefiles/app_dirs.inc.mk info-applications | grep -v tests/pkg/lvgl) + # + # Skipping examples because ... not sure, did it that way before + # https://github.com/RIOT-OS/rust-riot-wrappers/pull/68, and examples + # are built extra + # + # Skipping peripheral and driver tests because we don't implement those + # with wrappers; the valuable ones are those like saul where there are + # modules that use Rust. + DIRS=$(make -f makefiles/app_dirs.inc.mk info-applications | grep -v tests/pkg/lvgl |grep -v examples |grep -v periph |grep -v driver) export RIOTBASE=$(pwd)/RIOT for D in ${DIRS}; do echo "::group::Building ${D}" From 2883a28fe8673f02067784fe2c88da3b356756fc Mon Sep 17 00:00:00 2001 From: chrysn Date: Fri, 1 Dec 2023 19:44:19 +0100 Subject: [PATCH 17/19] CI: Better names for components --- .github/workflows/buildtest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index f2fd0d93..d08c91ae 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -10,7 +10,7 @@ on: workflow_dispatch: jobs: - build-examples: + quick-examples: runs-on: ubuntu-latest container: riot/riotbuild # Best would be "continue until there are errors from different examples *and* different boards" @@ -56,7 +56,7 @@ jobs: run: | make all BOARD=${{ matrix.board }} -C RIOT/${{ matrix.example }} - build-tests: + most-tests: runs-on: ubuntu-latest container: riot/riotbuild strategy: From 34fc0c5ff9832fcb328ab8c4bfa2162d1b53ef6b Mon Sep 17 00:00:00 2001 From: chrysn Date: Fri, 1 Dec 2023 19:48:07 +0100 Subject: [PATCH 18/19] CI: Unify workflows to show as a single item in the actions list --- .github/workflows/rustfmt.yml | 18 ------------------ .github/workflows/{buildtest.yml => test.yml} | 12 +++++++++++- 2 files changed, 11 insertions(+), 19 deletions(-) delete mode 100644 .github/workflows/rustfmt.yml rename .github/workflows/{buildtest.yml => test.yml} (96%) diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml deleted file mode 100644 index cac8241f..00000000 --- a/.github/workflows/rustfmt.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: rustfmt - -on: - pull_request: - push: - branches: [main] - workflow_dispatch: - -jobs: - rustfmt: - runs-on: ubuntu-latest - container: rustlang/rust:nightly - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Run cargo-fmt - run: cargo fmt --check diff --git a/.github/workflows/buildtest.yml b/.github/workflows/test.yml similarity index 96% rename from .github/workflows/buildtest.yml rename to .github/workflows/test.yml index d08c91ae..29d37f0a 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,7 @@ # Ideally this should be replaced with a call out to Murdock; until that is # practical, building representative examples. -name: build-test +name: test on: pull_request: @@ -141,3 +141,13 @@ jobs: echo "::endgroup::" done echo "::echo ::off" + + rustfmt: + runs-on: ubuntu-latest + container: rustlang/rust:nightly + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Run cargo-fmt + run: cargo fmt --check From 633d87c47e8dbd54812e67086f57e09204549a64 Mon Sep 17 00:00:00 2001 From: chrysn Date: Fri, 1 Dec 2023 19:54:06 +0100 Subject: [PATCH 19/19] CI: Fix cd screwup that made almost-no-tests run --- .github/workflows/test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 29d37f0a..959ce565 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -98,7 +98,7 @@ jobs: - name: Build and run tests run: | set -x - cd RIOT + export RIOTBASE=$(pwd)/RIOT # Removing tests/pkg/lvgl due to https://github.com/RIOT-OS/RIOT/issues/20110 # # Skipping examples because ... not sure, did it that way before @@ -108,8 +108,7 @@ jobs: # Skipping peripheral and driver tests because we don't implement those # with wrappers; the valuable ones are those like saul where there are # modules that use Rust. - DIRS=$(make -f makefiles/app_dirs.inc.mk info-applications | grep -v tests/pkg/lvgl |grep -v examples |grep -v periph |grep -v driver) - export RIOTBASE=$(pwd)/RIOT + DIRS=$(make --quiet -C ${RIOTBASE} -f makefiles/app_dirs.inc.mk info-applications | grep -v tests/pkg/lvgl |grep -v examples |grep -v periph |grep -v driver) for D in ${DIRS}; do echo "::group::Building ${D}" cd ${D}