From fb74e288da6014ca0e195a363dc21dccd9f20e0f Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Wed, 14 Aug 2024 20:22:34 +0200 Subject: [PATCH 1/6] ci: consistently rename macos -autotools build Use the same suffix string "-autotools" for "macos-x86_64-autotools" which the linux-x86_64-autotools build already uses. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 282548bea..a1878298d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -245,7 +245,7 @@ jobs: build/src/avrdude build/src/avrdude.conf - macos-x86_64_autotools: + macos-x86_64-autotools: runs-on: macos-latest steps: - uses: actions/checkout@v3 From 6e2152f1b90754a8b34d9044dd55abfc8286f16a Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Wed, 14 Aug 2024 13:35:45 +0200 Subject: [PATCH 2/6] ci: Use printf(1) to avoid echo(1) problems Use printf(1) to avoid possible echo(1) incompatibilities like special escape sequences and the like. Also, "\n\n" means two linefeeds, without any implicit linefeeds being added. Thought for the future: Perhaps test-avrdude should run isatty() and, if it is not a TTY, not wait for linefeeds at all in the non- interactive case? --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a1878298d..041a90cc3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -114,7 +114,7 @@ jobs: - name: Install run: sudo cmake --build build --target install - name: Dryrun_test - run: echo -e \\n | ./tools/test-avrdude -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28" + run: printf "\n\n" | ./tools/test-avrdude -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28" - name: Archive build artifacts if: always() uses: actions/upload-artifact@v3 From 184b00db48f7f93e435dff23b706069e964479d9 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Wed, 14 Aug 2024 14:08:34 +0200 Subject: [PATCH 3/6] ci: disable distcheck (until am doc builds have been fixed) The doc builds are a bit brittle at this time, and therefore do not work reliably with "make distcheck". Therefore this comments out "make distcheck" until the am doc builds have been fixed. --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 041a90cc3..f11703ce6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,8 +73,9 @@ jobs: run: sudo make -C _ambuild install - name: Dryrun_test run: printf "\n\n" | ./tools/test-avrdude -e _ambuild/avrdude -c '-C _ambuild/avrdude.conf' -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28" - - name: distcheck - run: make -C _ambuild -j$(nproc) distcheck + # Re-enable distcheck after the doc fixes + # - name: distcheck + # run: make -C _ambuild -j$(nproc) distcheck "DISTCHECK_CONFIGURE_FLAGS=--disable-doc" linux-x86_64: runs-on: ubuntu-latest From 06032113cfd3156d0755137dbd2276408b601ce1 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Sun, 18 Aug 2024 15:30:37 +0200 Subject: [PATCH 4/6] ci: Run test-avrdude with -v to show avrdude output on errors --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f11703ce6..933b9d4c2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,7 +72,7 @@ jobs: - name: Install run: sudo make -C _ambuild install - name: Dryrun_test - run: printf "\n\n" | ./tools/test-avrdude -e _ambuild/avrdude -c '-C _ambuild/avrdude.conf' -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28" + run: printf "\n\n" | ./tools/test-avrdude -v -e _ambuild/avrdude -c '-C _ambuild/avrdude.conf' -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28" # Re-enable distcheck after the doc fixes # - name: distcheck # run: make -C _ambuild -j$(nproc) distcheck "DISTCHECK_CONFIGURE_FLAGS=--disable-doc" @@ -115,7 +115,7 @@ jobs: - name: Install run: sudo cmake --build build --target install - name: Dryrun_test - run: printf "\n\n" | ./tools/test-avrdude -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28" + run: printf "\n\n" | ./tools/test-avrdude -v -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28" - name: Archive build artifacts if: always() uses: actions/upload-artifact@v3 From 415b397bc9e6911fb7bd34fb831e4058a1b37d97 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Mon, 19 Aug 2024 02:32:09 +0200 Subject: [PATCH 5/6] ci: Use ${{env.BUILD_TYPE}} instead of hardcoded value --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 933b9d4c2..2a20279a4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -321,8 +321,8 @@ jobs: !**/*.obj - name: Move executables run: | - mv build/src/RelWithDebInfo/avrdude.exe build/src - mv build/src/RelWithDebInfo/avrdude.pdb build/src + mv build/src/${{env.BUILD_TYPE}}/avrdude.exe build/src + mv build/src/${{env.BUILD_TYPE}}/avrdude.pdb build/src - name: Archive executables uses: actions/upload-artifact@v3 with: From c677974137993cb012f81de93465d8dd38ccebc9 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Sun, 18 Aug 2024 15:50:13 +0200 Subject: [PATCH 6/6] ci: Where possible, dryrun tests on uninstalled avrdude This tries running the uninstalled avrdude executable, both with -? and for test-avrdude. Tests on installed avrdude are kept where they exist, but not added for all possible platforms. Quick table showing * -? testing of built avrdude (print the usage) * dryrun testing of built avrdude before installation * installation of avrdude * dryrun testing of installed avrdude and whether that happens/succeeds/fails: run test test -? built install installed linux-x86_64-autotools | yes | succ | yes | succ linux-x86_64 | yes | succ | yes | succ linux (cross-compile) | yes# | n/a | no | <-- macos-x86_64 | yes | succ | no | <-- macos-x86_64-autotools | yes | succ | no | <-- msvc | yes* | succ | broken | <-- mingw | yes | fail | no | <-- # Only on i386, as the armhf and arm64 executables are not runnable on the ubuntu-latest x86_64 worker. * Works on x86 and x64. Skipped on arm64 at this time. The arm64 executable is not runnable, possibly due to the old problem of an exe being built for the wrong architecture (which @mcuee mentioned somewhere). In summary, this should run as much as is possible at this time without introducing failures. In the future, after these failures are fixed, more tests can be added for a more complete coverage. --- .github/workflows/build.yml | 47 +++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2a20279a4..ab5c9786c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,10 +69,16 @@ jobs: --enable-linuxspi - name: Build run: make -C _ambuild -j$(nproc) + - name: "avrdude -? (not installed)" + run: _ambuild/avrdude -? + - name: "Dryrun test (not installed)" + run: printf "\n\n" | ./tools/test-avrdude -v -e _ambuild/avrdude -c '-C _ambuild/avrdude.conf' -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28" - name: Install run: sudo make -C _ambuild install - - name: Dryrun_test - run: printf "\n\n" | ./tools/test-avrdude -v -e _ambuild/avrdude -c '-C _ambuild/avrdude.conf' -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28" + - name: "Dryrun test (installed)" + run: >- + export LD_LIBRARY_PATH="/usr/local/lib"; + printf "\n\n" | ./tools/test-avrdude -v -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28" # Re-enable distcheck after the doc fixes # - name: distcheck # run: make -C _ambuild -j$(nproc) distcheck "DISTCHECK_CONFIGURE_FLAGS=--disable-doc" @@ -112,9 +118,13 @@ jobs: -B build - name: Build run: cmake --build build + - name: "avrdude -? (not installed)" + run: build/src/avrdude -? + - name: "Dryrun test (not installed)" + run: printf "\n\n" | ./tools/test-avrdude -v -e build/src/avrdude -c '-C build/src/avrdude.conf' -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28" - name: Install run: sudo cmake --build build --target install - - name: Dryrun_test + - name: "Dryrun test (installed)" run: printf "\n\n" | ./tools/test-avrdude -v -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28" - name: Archive build artifacts if: always() @@ -182,6 +192,9 @@ jobs: -B build - name: Build run: cmake --build build + - name: "avrdude -? (not installed)" + if: matrix.arch == 'i386' + run: build/src/avrdude -? - name: Archive build artifacts if: always() uses: actions/upload-artifact@v3 @@ -229,6 +242,10 @@ jobs: -B build - name: Build run: cmake --build build + - name: "avrdude -? (not installed)" + run: build/src/avrdude -? + - name: "Dryrun test (not installed)" + run: printf "\n\n" | ./tools/test-avrdude -v -e build/src/avrdude -c '-C build/src/avrdude.conf' -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28" - name: Archive build artifacts if: always() uses: actions/upload-artifact@v3 @@ -278,7 +295,11 @@ jobs: - name: Build run: make -C _ambuild -j$(nproc) - + - name: "avrdude -? (not installed)" + run: _ambuild/avrdude -? + - name: "Dryrun test (not installed)" + run: printf "\n\n" | ./tools/test-avrdude -v -e _ambuild/avrdude -c '-C _ambuild/avrdude.conf' -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28" + msvc: runs-on: windows-latest strategy: @@ -310,6 +331,19 @@ jobs: -B build - name: Build run: cmake --build build --config ${{env.BUILD_TYPE}} + - name: "avrdude -? (not installed)" + # FIXME: Skip running avrdude. + # The exe file on arm64 is not runnable - x86_64 perhaps? + if: matrix.arch != 'arm64' + run: build/src/${{env.BUILD_TYPE}}/avrdude.exe -? + - name: "Dryrun test (not installed)" + # FIXME: Skip running avrdude. + # The exe file on arm64 is not runnable - x86_64 perhaps? + if: matrix.arch != 'arm64' + run: | + $tmp = [System.IO.Path]::GetTempPath() + $tmp_slash = $tmp -replace '\\', '/' + Write-Host "`n`n" -NoNewline | bash tools/test-avrdude -v -t "$tmp_slash" -e build/src/${{env.BUILD_TYPE}}/avrdude.exe -c "-C build/src/avrdude.conf" -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28" - name: Archive build artifacts if: always() uses: actions/upload-artifact@v3 @@ -373,6 +407,11 @@ jobs: -B build - name: Build run: cmake --build build + - name: "avrdude -? (not installed)" + run: build/src/avrdude -? + # Disabled so far due to problems writing to temp files. + # - name: "Dryrun test (not installed)" + # run: printf "\n\n" | ./tools/test-avrdude -v -e build/src/avrdude.exe -c "-C build/src/avrdude.conf" -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28" - name: Archive build artifacts if: always() uses: actions/upload-artifact@v3