Reuse Ocean's ebtree workflow #12
Workflow file for this run
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
# Copied from sociomantic-tsunami/ocean, keep in sync | |
name: CI | |
on: [push, pull_request] | |
jobs: | |
setup-ebtree: | |
uses: sociomantic-tsunami/ocean/.github/workflows/ebtree.yml@v6.x.x | |
with: | |
os: ubuntu-20.04 | |
main: | |
name: Run | |
strategy: | |
# Disable `fail-fast` because even if things fail for one compiler release | |
# or build flavour we still want to see how things perform with the others | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-20.04 ] | |
dc: [ dmd-2.092.1, dmd-2.093.1 ] | |
flavor: [ prod, devel ] | |
# Not a matrix row, but referenced as a constant in this file | |
ebtree_version: [ v6.0.socio10 ] | |
include: | |
- { dc: dmd-2.093.1, coverage: 1, closure_check: 1 } | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 30 | |
needs: setup-ebtree | |
steps: | |
- name: 'Restore ebtree ${{ matrix.ebtree_version }} from cache' | |
id: cache-ebtree | |
uses: actions/cache@v3 | |
with: | |
path: ${{ github.workspace }}/tools/ | |
key: ebtree-${{ matrix.ebtree_version }} | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libxslt-dev liblzo2-dev libgcrypt-dev libgpg-error-dev | |
sudo dpkg -i ${{ github.workspace }}/tools/ebtree/deb/libebtree6*.deb | |
- name: Install compiler | |
uses: dlang-community/setup-dlang@v1 | |
with: | |
compiler: ${{ matrix.dc }} | |
# Checkout this repository and its submodules | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
# Required for codecov (codecov/codecov-action#190) | |
fetch-depth: 2 | |
- name: Test | |
run: | | |
make all test V=1 F=${{ matrix.flavor }} COV=${{ matrix.coverage }} | |
- name: Test closures | |
if: ${{ matrix.closure_check == 1 }} | |
env: | |
F: ${{ matrix.flavor }} | |
DFLAGS: -vgc | |
run: | | |
# Run tests and write compiler output to temporary file | |
compiler_output=`mktemp` | |
make fasttest 2>&1 > $compiler_output | |
# Ensure there are no lines about closure allocations in the output. | |
# Note explicit check for `grep` exit status 1, i.e. no lines found. | |
! grep -e "closure" $compiler_output | |
- name: 'Upload coverage' | |
if: ${{ matrix.coverage == 1 }} | |
uses: codecov/codecov-action@v3 | |
with: | |
flags: ${{ matrix.dc }}-${{ matrix.flavor }} |