Skip to content

Commit

Permalink
ci: Where possible, dryrun tests on uninstalled avrdude
Browse files Browse the repository at this point in the history
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
  * dryrun installation of avrdude
  * 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.
  • Loading branch information
ndim committed Aug 24, 2024
1 parent f8c5eda commit ba1547d
Showing 1 changed file with 43 additions and 4 deletions.
47 changes: 43 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ba1547d

Please sign in to comment.