Skip to content

fixup

fixup #164

Workflow file for this run

---
name: Test
on: [push]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ${{ github.workspace }}
outputs:
HASH_KEY: ${{ steps.build-clone-main.outputs.HASH_KEY }}
steps:
- name: Clone Chez Scheme
id: build-clone-main
run: |
git clone --filter=blob:none --branch main https://github.com/cisco/ChezScheme.git
echo "HASH_KEY=v2_$(cat ChezScheme/.git/refs/heads/main)" >> "${GITHUB_OUTPUT}"
- name: Establish Chez Scheme .git / boot file cache
id: build-restore-bootfiles
uses: actions/cache@v4
env:
cache-name: boot-files
with:
path: |
ChezScheme/boot
ChezScheme/.git*
key: ${{ steps.build-clone-main.outputs.HASH_KEY }}
enableCrossOsArchive: true
- if: ${{ steps.build-restore-bootfiles.outputs.cache-hit != 'true' }}
name: Populate boot file cache
run: |
cd ChezScheme
git checkout v9.6.4
./configure -m=a6le
cd a6le/c
make -j 4
cd ../..
mkdir -p ../build/bin ../build/lib/csv9.6.4/a6le
cp a6le/bin/a6le/* ../build/bin
cp boot/a6le/* ../build/lib/csv9.6.4/a6le
export PATH=$(realpath ../build/bin):${PATH}
export SCHEMEHEAPDIRS=$(realpath ../build/lib/csv9.6.4/a6le):
git checkout main
git clean -dxf .
./configure --force -m=a6le
make re.boot
make
make bootquick XM=a6osx
make bootquick XM=arm64osx
make bootquick XM=a6nt
make bootquick XM=i3le
make bootquick XM=ta6nt
make bootquick XM=ta6le
mats:
continue-on-error: ${{ startsWith(matrix.machine, 't') }}
needs: build
strategy:
fail-fast: false
matrix:
config:
- machine: a6osx
os: macos-12
chez: v9.6.4
- machine: a6osx
os: macos-12
chez: main
- machine: arm64osx
os: macos-14
chez: main
- machine: i3le
os: ubuntu-22.04
chez: main
- machine: a6le
os: ubuntu-22.04
chez: v9.6.4
- machine: a6le
os: ubuntu-22.04
chez: main
- machine: ta6le
os: ubuntu-22.04
chez: main
- machine: i3nt
os: windows-2022
chez: v9.6.4
- machine: a6nt
os: windows-2019
chez: v9.6.4
- machine: a6nt
os: windows-2022
chez: v9.6.4
- machine: ta6nt
os: windows-2022
chez: v9.6.4
- machine: a6nt
os: windows-2022
chez: main
- machine: ta6nt
os: windows-2022
chez: main
runs-on: ${{ matrix.config.os }}
defaults:
run:
shell: bash
working-directory: ${{ github.workspace }}
steps:
- name: Setup 32-bit Linux
if: ${{ endsWith(matrix.config.machine, 'i3le') }}
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install gcc-multilib lib32ncurses5-dev\
libsystemd-dev:i386 uuid-dev:i386
- name: Setup 64-bit Linux
if: ${{ endsWith(matrix.config.machine, 'a6le') }}
run: |
sudo apt-get update
sudo apt-get install libsystemd-dev
- name: Setup Mac
if: ${{ runner.os == 'macOS' }}
run: |
brew install coreutils
echo "TIMEOUT_SCALE_FACTOR=10" >> $GITHUB_ENV
- name: Setup Windows
if: ${{ runner.os == 'Windows' }}
run: git config --global core.autocrlf false
- name: Checkout repository
uses: actions/checkout@v4
# the checkout action wipes the workarea, so do the checkout
# *before* we restore and build Chez Scheme from cache
- name: Restore Chez Scheme .git / boot file cache
id: mats-restore-bootfiles
uses: actions/cache@v4
env:
cache-name: boot-files
with:
path: |
ChezScheme/boot
ChezScheme/.git*
key: ${{ needs.build.outputs.HASH_KEY }}
enableCrossOsArchive: true
- name: Fail if no cache
if: ${{ steps.mats-restore-bootfiles.outputs.cache-hit != 'true' }}
run: exit 1
- name: Build Chez Scheme ${{ matrix.config.chez }}
run: |
M=${{ matrix.config.machine }}
cd ChezScheme
git checkout -q -f ${{ matrix.config.chez }}
git reset --hard ${{ matrix.config.chez }}
if [ "${{ matrix.config.chez }}" = "main" ]; then
./configure -m=$M --force
make bin/zuo
if [ "$RUNNER_OS" = "Windows" ]; then
cmd //c build.bat $M //force //as-is //MD //kernel
else
cd $M
../bin/zuo . kernel
cd ..
fi
else
./configure -m=$M
cd $M/c
make
cd ../..
fi
if [ "$RUNNER_OS" = "Windows" ]; then
echo "$(cygpath -u "$PWD/$M/bin/$M")" >> $GITHUB_PATH
echo "SCHEMEHEAPDIRS=$(cygpath -w "$PWD/$M/boot/$M")" >> $GITHUB_ENV
else
echo "$(realpath "$PWD/$M/bin/$M")" >> $GITHUB_PATH
echo "SCHEMEHEAPDIRS=$(realpath $PWD/$M/boot/$M)" >> $GITHUB_ENV
fi
echo "done building in $PWD"
- name: Build Swish
run: ./configure && make
- name: Run tests
run: make test || echo "Run tests failed" >> failures
- name: Archive test results
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.machine }}-${{ matrix.config.os }}-${{ matrix.config.chez }}-test
path: |
data/mat-report.html
src/swish/*.mo
- name: Run safe-check tests
if: ${{ matrix.config.chez == 'main' && !startsWith(matrix.config.os, 'macos') }}
run: .github/workflows/unless-failed.sh safe-check
- name: Run coverage
run: .github/workflows/unless-failed.sh coverage
- name: Archive coverage results
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.machine }}-${{ matrix.config.os }}-${{ matrix.config.chez }}-coverage
path: |
data/mat-report.html
src/swish/*.mo
- name: Archive coverage reports
if: ${{ matrix.config.chez == 'main' }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.machine }}-${{ matrix.config.os }}-${{ matrix.config.chez }}-coverage-report
path: |
data/coverage.html
data/src/**/*.html
- name: Assemble tarball
if: ${{ matrix.config.chez != 'main' && !startsWith(matrix.config.machine, 't') }}
# install only the binaries and replace absolute symlinks with relative symlinks
run: |
make -C src/swish install-bin INSTALLROOT="${PWD}/build/swish"
for f in $(find build/swish -type l); do
target="$(realpath "$f")"
ln -vsf "../$(realpath --relative-to="${PWD}/build/swish" "${target}")" "$f"
done
tar -cvf ${{ matrix.config.machine }}-${{ matrix.config.os }}-${{ matrix.config.chez }}-build.tar build/swish
- name: Archive build artifacts
if: ${{ matrix.config.chez != 'main' && !startsWith(matrix.config.machine, 't') }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.machine }}-${{ matrix.config.os }}-${{ matrix.config.chez }}-build.tar
path: ${{ matrix.config.machine }}-${{ matrix.config.os }}-${{ matrix.config.chez }}-build.tar
- name: Check for failures
run: if test -f failures; then cat failures; exit 1; fi