Skip to content

Merge pull request #714 from clj-commons/lread/maint-2026-01-20 #481

Merge pull request #714 from clj-commons/lread/maint-2026-01-20

Merge pull request #714 from clj-commons/lread/maint-2026-01-20 #481

Workflow file for this run

name: Test
on:
workflow_call: # for Publish
push:
branches:
- master
pull_request:
branches:
- master
jobs:
setup:
runs-on: ubuntu-latest
outputs:
skip_tests: ${{ steps.check_for_skip.outputs.skip_tests }}
tests: ${{ steps.set-tests.outputs.tests }}
steps:
- uses: actions/checkout@v6
- name: Clojure deps cache
uses: actions/cache@v5
with:
path: |
~/.m2/repository
~/.deps.clj
~/.gitlibs
enableCrossOsArchive: true
key: cljdeps-${{ hashFiles('deps.edn', 'bb.edn') }}
restore-keys: cljdeps-
- name: "Setup Java"
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '25'
- name: Install Clojure Tools
uses: DeLaGuardo/setup-clojure@13.5.2
with:
bb: 'latest'
# This assumes downloaded deps are same for all OSes
- name: Bring down deps
run: bb download-deps
- name: Check if Tests Should Run
id: check_for_skip
run: bb -ci-set-skip-tests
- id: set-tests
if: steps.check_for_skip.outputs.skip_tests == 'false'
name: Set test var for matrix
# run test.clj directly instead of via bb task to avoid generic task output
run: echo "tests=$(bb script/test_matrix.clj --format json)" >> $GITHUB_OUTPUT
build:
needs: setup
runs-on: ${{ matrix.os }}-latest
if: needs.setup.outputs.skip_tests == 'false'
strategy:
fail-fast: false
matrix:
include: ${{fromJSON(needs.setup.outputs.tests)}}
name: ${{ matrix.desc }}
steps:
- name: Don't convert line endings on checkout (Windows)
if: matrix.os == 'windows'
run: git config --global core.autocrlf false
- name: Tune Windows network
if: ${{ matrix.os == 'windows' }}
run: Disable-NetAdapterChecksumOffload -Name * -TcpIPv4 -UdpIPv4 -TcpIPv6 -UdpIPv6
- name: Tune macOS network
if: ${{ matrix.os == 'macos' }}
run: |
sudo sysctl -w net.link.generic.system.hwcksum_tx=0
sudo sysctl -w net.link.generic.system.hwcksum_rx=0
- name: Install Ubuntu X11 Utils
if: ${{ matrix.os == 'ubuntu' }}
run: sudo apt-get -y install x11-utils
- name: Install Linux Windows Manager
if: ${{ matrix.os == 'ubuntu' }}
run: sudo apt-get -y install fluxbox
# No longer pre-installed on macOS github action runners
- name: Install Image Magick on macOS
if: ${{ matrix.os == 'macos' && contains(matrix.needs, 'imagemagick') }}
run: brew install imagemagick
# No longer pre-install on ubuntu github action runners
- name: Install Image Magick on ubuntu
if: ${{ matrix.os == 'ubuntu' && contains(matrix.needs, 'imagemagick') }}
run: sudo apt-get -y install imagemagick
- uses: actions/checkout@v6
- name: Restore Clojure deps from cache
uses: actions/cache/restore@v5
with:
path: |
~/.m2/repository
~/.deps.clj
~/.gitlibs
enableCrossOsArchive: true
key: cljdeps-${{ hashFiles('deps.edn', 'bb.edn') }}
restore-keys: cljdeps-
- name: Cache fixup for Windows
# cache is restored using relative paths from Linux, this is not appropriate for Windows
# this is admitedly fragile/hackey, will revisit if it cracks
if: ${{ matrix.os == 'windows' }}
run: |
mv ../../../.m2 ${USERPROFILE}
mv ../../../.deps.clj ${USERPROFILE}
mv ../../../.gitlibs ${USERPROFILE}
shell: bash
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: ${{ matrix.jdk-version }}
- name: Install Clojure Tools
uses: DeLaGuardo/setup-clojure@13.5.2
with:
bb: 'latest'
- name: Tools versions
run: bb tools-versions
- name: Run Tests
env:
# default is 1min, try 4min to see if that helps with Windows http timeouts
ETAOIN_TIMEOUT: ${{ (matrix.os == 'windows' && '240') || '60' }}
run: ${{ matrix.cmd }}
- name: Upload test debug output
if: always()
uses: actions/upload-artifact@v6
with:
name: ${{ matrix.id }}-debug-screenshots
path: target/debug-screenshots/*
if-no-files-found: ignore