Skip to content

Enable mmap crash workaround more widely (copy #2566) #2345

Enable mmap crash workaround more widely (copy #2566)

Enable mmap crash workaround more widely (copy #2566) #2345

Workflow file for this run

name: CI
on:
push:
branches:
# PRs can only use caches from their target branch. We therefore need to
# make sure we run on 'master' too.
- master
- 1.6
pull_request:
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build_mac_windows:
name: Build and run limited tests
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: ["macOS", "windows"]
ghc: ["8.6.5", "8.8.4", "8.10.7", "9.0.2"]
exclude:
# Some tests fail with a mysterious -11 error code.
- os: macOS
ghc: 8.10.7
# Windows gets non-deterministically gets stuck in infinite loops
# or segfaults while running the testcase.
- os: windows
ghc: 8.8.4
steps:
- uses: actions/checkout@v3
- uses: haskell/actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
enable-stack: true
- name: Install IVerilog (macOS)
if: matrix.os == 'macOS'
run: brew install icarus-verilog
- name: Install IVerilog (Windows)
if: matrix.os == 'Windows'
run: choco install --no-progress iverilog
- name: General Setup
run: |
cp .ci/stack-${{ matrix.ghc }}.yaml stack.yaml
- name: Cache (Windows)
if: ${{ runner.os == 'Windows' }}
uses: actions/cache@v3
with:
# On windows we have to use "\" as a path seperator, otherwise caching fails
path: |
${{ steps.setup-haskell.outputs.stack-root }}\snapshots
key: ${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('stack.yaml', '**/*.cabal', '.github/workflows/ci.yml') }}
restore-keys: ${{ matrix.os }}-${{ matrix.ghc }}-
- name: Cache (non-Windows)
if: ${{ runner.os != 'Windows' }}
uses: actions/cache@v3
with:
path: |
${{ steps.setup-haskell.outputs.stack-root }}/snapshots
key: ${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('stack.yaml', '**/*.cabal', '.github/workflows/ci.yml') }}
restore-keys: ${{ matrix.os }}-${{ matrix.ghc }}-
# https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/188
# https://github.com/commercialhaskell/stack/issues/4937
# - name: Use system GHC
# run: stack config set system-ghc --global true
# Retry Stack initialization, see:
# https://github.com/commercialhaskell/stack/issues/5770
- name: Initialize Stack
run: ./.ci/initialize_stack.sh
- name: Build with Stack
run: stack build
- name: Run Vector testsuite
run: stack run -- clash-testsuite --hide-successes -p .Vector. --no-ghdl --no-verilator --no-modelsim
build_and_test:
# Only run for external PRs
if: github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
name: Build and Test
strategy:
matrix:
include:
- name: GHC 8.6.5, Single Hidden
ghc: 8.6.5
multiple_hidden: no
workaround_ghc_mmap_crash: yes
- name: GHC 8.8.4, Multiple Hidden
ghc: 8.8.4
multiple_hidden: yes
workaround_ghc_mmap_crash: yes
- name: GHC 8.10.7, Multiple Hidden
ghc: 8.10.7
multiple_hidden: yes
workaround_ghc_mmap_crash: yes
- name: GHC 9.0.2, Multiple Hidden
ghc: 9.0.2
multiple_hidden: yes
workaround_ghc_mmap_crash: yes
# Run steps inside the clash CI docker image
container:
image: ghcr.io/clash-lang/clash-ci-${{ matrix.ghc }}:2023-08-22
env:
THREADS: 2
CABAL_JOBS: 2
MULTIPLE_HIDDEN: ${{ matrix.multiple_hidden }}
CI_COMMIT_BRANCH: ${{ github.base_ref }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Setup CI
run: |
./.ci/setup.sh
cabal v2-freeze
# We only want this for caching, and it makes the CI scripts way
# more brittle than is ideal.
mv cabal.project.freeze frozen
- name: Restore Cache
uses: actions/cache@v3
with:
path: |
dist-newstyle
~/.cabal/packages
~/.cabal/store
key: ${{ matrix.ghc }}-${{ hashFiles('frozen') }}
restore-keys: ${{ matrix.ghc }}-
- name: Build Clash
run: ./.ci/build.sh
- name: Unit Tests
run: |
cabal v2-test clash-prelude
cabal v2-test clash-lib
cabal v2-test clash-cores
cabal v2-test clash-cosim
- name: Testsuite (VHDL)
run: cabal v2-run clash-testsuite -- -j$THREADS --hide-successes -p .VHDL
- name: Testsuite (Verilog)
run: cabal v2-run clash-testsuite -- -j$THREADS --hide-successes -p .Verilog
- name: Testsuite (SystemVerilog)
run: cabal v2-run clash-testsuite -- -j$THREADS --hide-successes -p .SystemVerilog --no-modelsim
all:
name: All jobs finished
if: always()
needs: [
build_mac_windows,
build_and_test,
]
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check dependencies for failures
run: |
# Test all dependencies for success/failure
set -x
success="${{ contains(needs.*.result, 'success') }}"
fail="${{ contains(needs.*.result, 'failure') }}"
set +x
# Test whether success/fail variables contain sane values
if [[ "${success}" != "true" && "${success}" != "false" ]]; then exit 1; fi
if [[ "${fail}" != "true" && "${fail}" != "false" ]]; then exit 1; fi
# We want to fail if one or more dependencies fail. For safety, we introduce
# a second check: if no dependencies succeeded something weird is going on.
if [[ "${fail}" == "true" || "${success}" == "false" ]]; then
echo "One or more dependency failed, or no dependency succeeded."
exit 1
fi
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install python3-yaml
- name: Check that the 'all' job depends on all other jobs
run: |
.ci/all_check.py