build fix for ghc-9.6 #4
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: CI | |
# Trigger the workflow on push or pull request | |
on: | |
# workflow_dispatch: | |
pull_request: | |
# branches: [master] | |
types: [synchronize, opened, reopened] | |
push: | |
# branches: [main] | |
paths: | |
- '.github/workflows/ci.yml' | |
- 'cabal.project' | |
- 'stack.yaml' | |
- 'llvm-hs/llvm-hs.cabal' | |
- 'llvm-hs/src/**' | |
- 'llvm-hs/test/**' | |
- 'llvm-hs-pure/llvm-hs-pure.cabal' | |
- 'llvm-hs-pure/src/**' | |
- 'llvm-hs-pure/test/**' | |
schedule: | |
# additionally run once per week (At 00:00 on Sunday) to maintain cache | |
- cron: '0 0 * * 0' | |
jobs: | |
cabal: | |
name: cabal | ${{ matrix.sys.os }}-${{ matrix.arch }} ghc-${{ matrix.ghc }} | |
runs-on: ${{ matrix.sys.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
sys: | |
- { os: 'ubuntu-latest', shell: 'bash' } | |
- { os: 'macOS-latest', shell: 'bash' } | |
- { os: 'windows-latest', shell: 'msys2 {0}' } | |
arch: | |
- 'x64' | |
- 'ARM64' | |
ghc: | |
- 'latest' | |
- '9.6' | |
- '9.4' | |
- '9.2' | |
- '9.0' | |
- '8.10' | |
exclude: | |
- arch: 'ARM64' | |
defaults: | |
run: | |
shell: ${{ matrix.sys.shell }} | |
env: | |
CABAL_FLAGS: --enable-tests --test-show-details=direct | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/checkout@v3 | |
with: | |
repository: actions/cache | |
path: .github/actions/cache-always | |
ref: v3 | |
# Tweak `action.yml` of `actions/cache@v3` to remove the `post-if` | |
# condition, making it default to `post-if: always ()`. | |
- name: Run actions/cache-always@v3 | |
run: | | |
sed -i -e '/ post-if: /d' .github/actions/cache-always/action.yml | |
shell: bash | |
- uses: msys2/setup-msys2@v2 | |
if: matrix.sys.os == 'windows-latest' | |
with: | |
path-type: inherit | |
msystem: clang64 | |
- uses: haskell/actions/setup@v2 | |
id: setup-haskell | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: latest | |
- name: Set up environment (ubuntu) | |
if: matrix.sys.os == 'ubuntu-latest' | |
run: | | |
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" | |
sudo apt-get update | |
sudo apt-get -y install llvm-15-dev | |
- name: Set up environment (macOS) | |
if: matrix.sys.os == 'macOS-latest' | |
run: | | |
brew install llvm@15 | |
mkdir -p $HOME/.local/bin | |
ln -s $(brew --prefix llvm@15)/bin/llvm-config $HOME/.local/bin/llvm-config-15 | |
ln -s $(brew --prefix llvm@15)/bin/llvm-config $HOME/.local/bin/ | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Set up environment (windows) | |
if: matrix.sys.os == 'windows-latest' | |
run: | | |
# https://stackoverflow.com/questions/33969803/how-to-obtain-older-versions-of-packages-using-msys2 | |
# https://packages.msys2.org/package/mingw-w64-clang-x86_64-llvm | |
curl -LO https://mirror.msys2.org/mingw/clang64/mingw-w64-clang-x86_64-llvm-15.0.7-3-any.pkg.tar.zst | |
pacman -U --noconfirm mingw-w64-clang-x86_64-llvm-15.0.7-3-any.pkg.tar.zst | |
- name: Configure | |
run: cabal configure $CABAL_FLAGS | |
- name: Freeze | |
run: cabal freeze | |
- name: actions/cache-always@v3 | |
uses: ./.github/actions/cache-always | |
with: | |
path: | | |
${{ steps.setup-haskell.outputs.cabal-store }} | |
dist-newstyle | |
key: ${{ runner.os }}-${{ matrix.arch }}-${{ matrix.ghc }}-cabal-${{ hashFiles('cabal.project.freeze') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.arch }}-${{ matrix.ghc }}-cabal-${{ hashFiles('cabal.project.freeze') }} | |
${{ runner.os }}-${{ matrix.arch }}-${{ matrix.ghc }}-cabal- | |
- name: Build dependencies | |
run: cabal build all --only-dependencies | |
- name: Build llvm-hs-pure | |
run: cabal build llvm-hs-pure | |
- name: Build llvm-hs | |
run: cabal build llvm-hs | |
- name: Test llvm-hs-pure | |
run: cabal test llvm-hs-pure | |
- name: Test llvm-hs | |
run: cabal test llvm-hs | |
- name: Haddock llvm-hs-pure | |
run: cabal haddock llvm-hs-pure | |
- name: Haddock llvm-hs | |
run: cabal haddock llvm-hs | |
stack: | |
name: stack | ${{ matrix.sys.os }}-${{ matrix.arch }} | |
runs-on: ${{ matrix.sys.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
sys: | |
- { os: 'ubuntu-latest', shell: 'bash' } | |
- { os: 'macOS-latest', shell: 'bash' } | |
- { os: 'windows-latest', shell: 'msys2 {0}' } | |
arch: | |
- 'x64' | |
- 'ARM64' | |
exclude: | |
- arch: 'ARM64' | |
defaults: | |
run: | |
shell: ${{ matrix.sys.shell }} | |
env: | |
CABAL_FLAGS: --enable-tests --test-show-details=direct | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/checkout@v3 | |
with: | |
repository: actions/cache | |
path: .github/actions/cache-always | |
ref: v3 | |
# Tweak `action.yml` of `actions/cache@v3` to remove the `post-if` | |
# condition, making it default to `post-if: always ()`. | |
- name: Run actions/cache-always@v3 | |
run: | | |
sed -i -e '/ post-if: /d' .github/actions/cache-always/action.yml | |
shell: bash | |
- uses: msys2/setup-msys2@v2 | |
if: matrix.sys.os == 'windows-latest' | |
with: | |
path-type: inherit | |
msystem: clang64 | |
- uses: haskell/actions/setup@v2 | |
id: setup-haskell | |
with: | |
enable-stack: true | |
stack-no-global: true | |
- name: actions/cache-always@v3 | |
uses: ./.github/actions/cache-always | |
with: | |
path: | | |
${{ steps.setup-haskell.outputs.stack-root }} | |
.stack-work | |
key: ${{ runner.os }}-${{ matrix.arch }}-stack-${{ hashFiles('stack.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.arch }}-stack-${{ hashFiles('stack.yaml') }} | |
${{ runner.os }}-${{ matrix.arch }}-stack- | |
- name: Set up environment (ubuntu) | |
if: matrix.sys.os == 'ubuntu-latest' | |
run: | | |
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" | |
sudo apt-get update | |
sudo apt-get -y install llvm-15-dev | |
- name: Set up environment (macOS) | |
if: matrix.sys.os == 'macOS-latest' | |
run: | | |
brew install llvm@15 | |
mkdir -p $HOME/.local/bin | |
ln -s $(brew --prefix llvm@15)/bin/llvm-config $HOME/.local/bin/llvm-config-15 | |
ln -s $(brew --prefix llvm@15)/bin/llvm-config $HOME/.local/bin/ | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Set up environment (windows) | |
if: matrix.sys.os == 'windows-latest' | |
run: | | |
# https://stackoverflow.com/questions/33969803/how-to-obtain-older-versions-of-packages-using-msys2 | |
# https://packages.msys2.org/package/mingw-w64-clang-x86_64-llvm | |
curl -LO https://mirror.msys2.org/mingw/clang64/mingw-w64-clang-x86_64-llvm-15.0.7-3-any.pkg.tar.zst | |
pacman -U --noconfirm mingw-w64-clang-x86_64-llvm-15.0.7-3-any.pkg.tar.zst | |
- name: Setup | |
run: stack setup | |
- name: Build dependencies | |
run: stack build --only-dependencies | |
- name: Build | |
run: stack build | |
# vi: nospell |