freshly brewed Octave #1231
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
name: "freshly brewed Octave" | |
on: | |
# push: | |
workflow_dispatch: | |
schedule: | |
# Run job every day at 22:30 UTC | |
- cron: '30 22 * * *' | |
jobs: | |
check: | |
name: Windows test suite | |
runs-on: windows-latest | |
defaults: | |
run: | |
# Use pre-installed MSYS2 as default shell | |
shell: C:/msys64/usr/bin/bash.exe --login -eo pipefail "{0}" | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [w64-default, w64, w64-64] | |
include: | |
- target: w64-default | |
file-suffix: default-w64 | |
folder-suffix: w64 | |
mingw-prefix: mingw64 | |
- target: w64 | |
file-suffix: release-w64 | |
folder-suffix: w64 | |
mingw-prefix: mingw64 | |
- target: w64-64 | |
file-suffix: release-w64-64 | |
folder-suffix: w64-64 | |
mingw-prefix: mingw64 | |
env: | |
MSYSTEM: MSYS | |
CHERE_INVOKING: 1 | |
steps: | |
- name: get CPU name | |
shell: pwsh | |
run : | | |
Get-CIMInstance -Class Win32_Processor | Select-Object -Property Name | |
- name: prepare cache | |
# Create human readable timestamp | |
id: cache_timestamp | |
run: | | |
echo "timestamp=$(date +"%Y-%m-%d_%H-%M-%S")" >> $GITHUB_OUTPUT | |
- name: setup cache | |
id: setup-cache | |
uses: actions/cache/restore@v4 | |
with: | |
path: oldid/${{ matrix.target }} | |
key: oldid:${{ matrix.target }}:${{ steps.cache_timestamp.outputs.timestamp }}:${{ github.sha }} | |
restore-keys: oldid:${{ matrix.target }} | |
- name: check build id | |
id: check-id | |
env: | |
TARGET: ${{ matrix.target }} | |
run: | | |
BUILDID=$(curl -s "https://nightly.octave.org/api/v2/builders/octave/builds?state_string__eq=build%20successful&order=-started_at&limit=1" | grep "number" | grep -o "[0-9]*") | |
echo buildid: "${BUILDID}" | |
echo "buildid=${BUILDID}" >> $GITHUB_OUTPUT | |
mkdir -p oldid/${TARGET} | |
test -f oldid/${TARGET}/id && OLDBUILDID=$(cat oldid/${TARGET}/id) | |
echo oldbuildid: "${OLDBUILDID}" | |
echo "oldbuildid=${OLDBUILDID}" >> $GITHUB_OUTPUT | |
- name: download build | |
id: download | |
if: steps.check-id.outputs.buildid != steps.check-id.outputs.oldbuildid | |
env: | |
BUILDID: ${{ steps.check-id.outputs.buildid }} | |
FILE_SUFFIX: ${{ matrix.file-suffix }} | |
run: | | |
curl --insecure --output index.html "https://nightly.octave.org/data/stable/${BUILDID}/" | |
FILE7Z=$(grep -r "\-${FILE_SUFFIX}.7z" index.html | grep -o -P -m 1 "octave-[0-9\-]*-${FILE_SUFFIX}.7z" | head -n1 -) | |
curl --insecure --output octave-${FILE_SUFFIX}.7z "https://nightly.octave.org/data/stable/${BUILDID}/${FILE7Z}" | |
echo "file7z=${FILE7Z}" >> $GITHUB_OUTPUT | |
- name: unpack | |
if: steps.check-id.outputs.buildid != steps.check-id.outputs.oldbuildid | |
shell: cmd | |
env: | |
FILE_SUFFIX: ${{ matrix.file-suffix }} | |
run: 7z.exe x -y octave-%FILE_SUFFIX%.7z | |
- name: prepare | |
if: steps.check-id.outputs.buildid != steps.check-id.outputs.oldbuildid | |
env: | |
FILE7Z: ${{ steps.download.outputs.file7z }} | |
FOLDER_SUFFIX: ${{ matrix.folder-suffix }} | |
MY_MINGW_PREFIX: ${{ matrix.mingw-prefix }} | |
run: | | |
cd $(echo ${FILE7Z} | grep -o -P "octave-[0-9\-]*")${FOLDER_SUFFIX} | |
./post-install.bat | |
echo "Use OpenBLAS" | |
cp ./${MY_MINGW_PREFIX}/bin/libopenblas.dll ./${MY_MINGW_PREFIX}/bin/libblas.dll | |
- name: show hg ids | |
if: steps.check-id.outputs.buildid != steps.check-id.outputs.oldbuildid | |
env: | |
FILE7Z: ${{ steps.download.outputs.file7z }} | |
FOLDER_SUFFIX: ${{ matrix.folder-suffix }} | |
run: | | |
cd $(echo ${FILE7Z} | grep -o -P "octave-[0-9\-]*")${FOLDER_SUFFIX} | |
echo MXE Octave hg id: | |
cat HG-ID | |
echo Octave hg id: | |
./octave-launch.exe --no-gui --no-init-file --silent --no-history --eval "fprintf ('%s', version ('-hgid'))" | |
- name: run test suite | |
if: steps.check-id.outputs.buildid != steps.check-id.outputs.oldbuildid | |
env: | |
FILE7Z: ${{ steps.download.outputs.file7z }} | |
FOLDER_SUFFIX: ${{ matrix.folder-suffix }} | |
# Write access to the /tmp folder that MSYS2 uses by default seems to be restricted. | |
run: | | |
export TMP="$RUNNER_TEMP" | |
export TEMP="$RUNNER_TEMP" | |
export OPENBLAS_NUM_THREADS=2 | |
cd $(echo ${FILE7Z} | grep -o -P "octave-[0-9\-]*")${FOLDER_SUFFIX} | |
./octave-launch.exe --no-gui --no-init-file --silent --no-history --eval __run_test_suite__ | tee ./test-suite.log | |
- name: display log | |
if: steps.check-id.outputs.buildid != steps.check-id.outputs.oldbuildid | |
env: | |
FILE7Z: ${{ steps.download.outputs.file7z }} | |
FOLDER_SUFFIX: ${{ matrix.folder-suffix }} | |
run: | | |
cd $(echo ${FILE7Z} | grep -o -P "octave-[0-9\-]*")${FOLDER_SUFFIX} | |
cat ./fntests.log | |
- name: save current build id | |
if: steps.check-id.outputs.buildid != steps.check-id.outputs.oldbuildid | |
env: | |
BUILDID: ${{ steps.check-id.outputs.buildid }} | |
TARGET: ${{ matrix.target }} | |
run: echo $BUILDID > oldid/${TARGET}/id | |
- name: save cache with build id | |
if: steps.check-id.outputs.buildid != steps.check-id.outputs.oldbuildid | |
uses: actions/cache/save@v4 | |
with: | |
path: oldid/${{ matrix.target }} | |
key: oldid:${{ matrix.target }}:${{ steps.cache_timestamp.outputs.timestamp }}:${{ github.sha }} | |
- name: test packages | |
if: steps.check-id.outputs.buildid != steps.check-id.outputs.oldbuildid | |
env: | |
FILE7Z: ${{ steps.download.outputs.file7z }} | |
FOLDER_SUFFIX: ${{ matrix.folder-suffix }} | |
MY_MINGW_PREFIX: ${{ matrix.mingw-prefix }} | |
run: | | |
export TMP="$RUNNER_TEMP" | |
export TEMP="$RUNNER_TEMP" | |
export OPENBLAS_NUM_THREADS=2 | |
cd $(echo ${FILE7Z} | grep -o -P "octave-[0-9\-]*")${FOLDER_SUFFIX} | |
pkgs=("audio" | |
"biosig" | |
"cfitsio" | |
"communications" | |
"control" | |
"data-smoothing" | |
"database" | |
"dataframe" | |
"dicom" | |
"financial" | |
"fuzzy-logic-toolkit" | |
"ga" | |
"general" | |
"generate_html" | |
"geometry" | |
"gsl" | |
"image" | |
"instrument-control" | |
"interval" | |
"io" | |
"linear-algebra" | |
"lssa" | |
"ltfat" | |
"mapping" | |
"matgeom" | |
"miscellaneous" | |
"mqtt" | |
"nan" | |
"netcdf" | |
"nurbs" | |
"ocs" | |
"octproj" | |
"optim" | |
"optiminterp" | |
"quaternion" | |
"queueing" | |
"signal" | |
"sockets" | |
"sparsersb" | |
"splines" | |
"statistics" | |
"stk" | |
"strings" | |
"struct" | |
"symbolic" | |
"tablicious" | |
"tsa" | |
"video" | |
"windows" | |
"zeromq") | |
for pkg in "${pkgs[@]}" | |
do | |
printf " \033[0;32m==>\033[0m Testing package \033[0;32m${pkg}\033[0m\n" | |
echo "::group::Test package $pkg" | |
( ./octave-launch.exe --no-gui --no-init-file --silent --no-history \ | |
--eval "installed_pkg = pkg ('list', '$pkg'); fprintf ('version: %s\n', installed_pkg{1}.version); pkg ('test', '$pkg')" \ | |
|| echo "::error::Octave terminated with error code $? during tests for package $pkg" ) \ | |
| tee ./test-$pkg.log | |
echo "::endgroup::" | |
echo "::group::Display log for package $pkg" | |
cat ./fntests.log | |
echo "::endgroup::" | |
[ -n "$(grep -e "FAIL\s*0" ./test-$pkg.log)" ] || echo "::warning::At least one test failed for package $pkg" | |
[ -z "$(grep -e "REGRESSION" ./test-$pkg.log)" ] || echo "::warning::At least one regression in tests for package $pkg" | |
echo Finished tests for package $pkg | |
done | |
- name: analyze test suite result | |
if: steps.check-id.outputs.buildid != steps.check-id.outputs.oldbuildid | |
env: | |
FILE7Z: ${{ steps.download.outputs.file7z }} | |
FOLDER_SUFFIX: ${{ matrix.folder-suffix }} | |
run: | | |
cd $(echo ${FILE7Z} | grep -o -P "octave-[0-9\-]*")${FOLDER_SUFFIX} | |
[ -n "$(grep -e "FAIL\s*0" ./test-suite.log)" ] || exit 1 | |
[ -z "$(grep -e "REGRESSION" ./test-suite.log)" ] || exit 1 |