Skip to content

Commit

Permalink
Try different ghc-source-gen commit
Browse files Browse the repository at this point in the history
  • Loading branch information
avdv committed Nov 20, 2023
1 parent 528223b commit b9ebf71
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 108 deletions.
213 changes: 106 additions & 107 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Continuous integration
on:
push:
branches: master
pull_request:
branches: master
workflow_dispatch: # allows manual triggering
Expand All @@ -10,108 +9,108 @@ env:
cache-version: 0

jobs:
test-nixpkgs:
name: Build & Test - Nixpkgs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.module }}-${{ matrix.bzlmod }}-${{ matrix.ghc }}-nixpkgs
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-11]
module: [rules_haskell, rules_haskell_nix, rules_haskell_tests]
bzlmod: [true, false]
ghc:
- 9.2.8
- 9.4.6
exclude:
- module: rules_haskell_nix
bzlmod: false
# TODO: in a MODULE.bazel file we declare version specific dependencies, would need to use stack snapshot json
# and stack config per GHC version
- ghc: 9.4.6
bzlmod: true
runs-on: ${{ matrix.os }}
steps:
- if: ${{ matrix.os == 'ubuntu-latest' }}
run: |-
sudo swapoff -a
sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc
docker rmi $(docker images -q) -f
- uses: actions/checkout@v4
- name: Mount Bazel cache
uses: actions/cache@v3
with:
path: ~/repo-cache
key: repo-cache-${{ runner.os }}-nixpkgs-${{ env.cache-version }}
- uses: cachix/install-nix-action@v23
with:
nix_path: nixpkgs=./nixpkgs/default.nix
extra_nix_config: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
extra-substituters = https://cache.iog.io
- name: Configure
env:
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
run: |
# Avoid failures of the form `deadline exceeded after 14999958197ns DEADLINE_EXCEEDED`.
# See https://github.com/tweag/rules_haskell/issues/1498 and https://github.com/tweag/rules_haskell/pull/1692.
[[ ${{ runner.os }} == Linux ]] && sudo sysctl -w net.ipv4.tcp_keepalive_time=60
case ${{ runner.os }} in
macOS) BUILD_CONFIG=ci-macos-nixpkgs;;
Linux) BUILD_CONFIG=ci-linux-nixpkgs;;
esac
if [ -z "$BUILDBUDDY_API_KEY" ]; then
cache_setting='--noremote_upload_local_results'
else
cache_setting="--remote_header=x-buildbuddy-api-key=$BUILDBUDDY_API_KEY"
fi
cat >.bazelrc.local <<EOF
common --config=ci
build --config=$BUILD_CONFIG
build $cache_setting
common --enable_bzlmod=${{ matrix.bzlmod }}
EOF
cp .bazelrc.local rules_haskell_nix
cp .bazelrc.local rules_haskell_tests
cat >~/.netrc <<EOF
machine api.github.com
password ${{ secrets.GITHUB_TOKEN }}
EOF
- name: Check Bazel version
run: |
nix-shell --arg docTools false --argstr ghcVersion ${{ matrix.ghc }} --pure --run .ci/check-bazel-version
- name: Build & test - rules_haskell
if: matrix.module == 'rules_haskell'
run: |
nix-shell --arg docTools false --argstr ghcVersion ${{ matrix.ghc }} --pure --run '
set -euo pipefail
bazel test //...
bazel build //docs:api_html
bazel build //docs:guide_html
'
- name: Build & test - rules_haskell_nix
if: matrix.module == 'rules_haskell_nix'
run: |
nix-shell --arg docTools false --argstr ghcVersion ${{ matrix.ghc }} --pure --run '
set -euo pipefail
cd rules_haskell_nix
bazel test //...
'
- name: Build & test - rules_haskell_tests
if: matrix.module == 'rules_haskell_tests'
run: |
nix-shell --arg docTools false --argstr ghcVersion ${{ matrix.ghc }} --pure --run '
set -euo pipefail
cd rules_haskell_tests
# XXX run start script `--with-bzlmod=true` when supported
if ! ${{ matrix.bzlmod }}; then
./tests/run-start-script.sh --use-nix --with-bzlmod=${{ matrix.bzlmod }}
fi
bazel build //tests:run-tests
./bazel-ci-bin/tests/run-tests
bazel coverage //...
'
# test-nixpkgs:
# name: Build & Test - Nixpkgs
# concurrency:
# group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.module }}-${{ matrix.bzlmod }}-${{ matrix.ghc }}-nixpkgs
# cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest, macos-11]
# module: [rules_haskell, rules_haskell_nix, rules_haskell_tests]
# bzlmod: [true, false]
# ghc:
# - 9.2.8
# - 9.4.6
# exclude:
# - module: rules_haskell_nix
# bzlmod: false
# # TODO: in a MODULE.bazel file we declare version specific dependencies, would need to use stack snapshot json
# # and stack config per GHC version
# - ghc: 9.4.6
# bzlmod: true
# runs-on: ${{ matrix.os }}
# steps:
# - if: ${{ matrix.os == 'ubuntu-latest' }}
# run: |-
# sudo swapoff -a
# sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc
# docker rmi $(docker images -q) -f
# - uses: actions/checkout@v4
# - name: Mount Bazel cache
# uses: actions/cache@v3
# with:
# path: ~/repo-cache
# key: repo-cache-${{ runner.os }}-nixpkgs-${{ env.cache-version }}
# - uses: cachix/install-nix-action@v23
# with:
# nix_path: nixpkgs=./nixpkgs/default.nix
# extra_nix_config: |
# trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
# extra-substituters = https://cache.iog.io
# - name: Configure
# env:
# BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
# run: |
# # Avoid failures of the form `deadline exceeded after 14999958197ns DEADLINE_EXCEEDED`.
# # See https://github.com/tweag/rules_haskell/issues/1498 and https://github.com/tweag/rules_haskell/pull/1692.
# [[ ${{ runner.os }} == Linux ]] && sudo sysctl -w net.ipv4.tcp_keepalive_time=60
# case ${{ runner.os }} in
# macOS) BUILD_CONFIG=ci-macos-nixpkgs;;
# Linux) BUILD_CONFIG=ci-linux-nixpkgs;;
# esac
# if [ -z "$BUILDBUDDY_API_KEY" ]; then
# cache_setting='--noremote_upload_local_results'
# else
# cache_setting="--remote_header=x-buildbuddy-api-key=$BUILDBUDDY_API_KEY"
# fi
# cat >.bazelrc.local <<EOF
# common --config=ci
# build --config=$BUILD_CONFIG
# build $cache_setting
# common --enable_bzlmod=${{ matrix.bzlmod }}
# EOF
# cp .bazelrc.local rules_haskell_nix
# cp .bazelrc.local rules_haskell_tests
# cat >~/.netrc <<EOF
# machine api.github.com
# password ${{ secrets.GITHUB_TOKEN }}
# EOF
# - name: Check Bazel version
# run: |
# nix-shell --arg docTools false --argstr ghcVersion ${{ matrix.ghc }} --pure --run .ci/check-bazel-version
# - name: Build & test - rules_haskell
# if: matrix.module == 'rules_haskell'
# run: |
# nix-shell --arg docTools false --argstr ghcVersion ${{ matrix.ghc }} --pure --run '
# set -euo pipefail
# bazel test //...
# bazel build //docs:api_html
# bazel build //docs:guide_html
# '
# - name: Build & test - rules_haskell_nix
# if: matrix.module == 'rules_haskell_nix'
# run: |
# nix-shell --arg docTools false --argstr ghcVersion ${{ matrix.ghc }} --pure --run '
# set -euo pipefail
# cd rules_haskell_nix
# bazel test //...
# '
# - name: Build & test - rules_haskell_tests
# if: matrix.module == 'rules_haskell_tests'
# run: |
# nix-shell --arg docTools false --argstr ghcVersion ${{ matrix.ghc }} --pure --run '
# set -euo pipefail
# cd rules_haskell_tests
# # XXX run start script `--with-bzlmod=true` when supported
# if ! ${{ matrix.bzlmod }}; then
# ./tests/run-start-script.sh --use-nix --with-bzlmod=${{ matrix.bzlmod }}
# fi
# bazel build //tests:run-tests
# ./bazel-ci-bin/tests/run-tests
# bazel coverage //...
# '

test-bindist:
name: Build & Test - bindist
Expand All @@ -125,8 +124,8 @@ jobs:
module: [rules_haskell, rules_haskell_tests]
bzlmod: [true, false]
ghc:
- 9.2.8
- 9.4.6
#- 9.2.8
#- 9.4.6
- 9.6.2
exclude:
# TODO: in a MODULE.bazel file we declare version specific dependencies, would need to use stack snapshot json
Expand All @@ -136,8 +135,8 @@ jobs:
- ghc: 9.6.2
bzlmod: true
# currently proto-lens-protoc fails with an access violation on Windows
- ghc: 9.6.2
os: windows-latest
#- ghc: 9.6.2
# os: windows-latest
env:
# prevent auto-detection of system compilers on Windows
BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN: ${{ matrix.os == 'windows-latest' && 1 || 0 }}
Expand Down
2 changes: 1 addition & 1 deletion stackage_snapshot_9.6.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ packages:

# support GHC 9.6
- git: https://github.com/avdv/ghc-source-gen
commit: 4bc81b85c21094d1dc38b86205b1725b379a6e83
commit: 1e5244e4025302e8b028d02714682185f1f4b626

0 comments on commit b9ebf71

Please sign in to comment.