Skip to content

Commit

Permalink
ci: remove cabal builds, add nix builds
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjm committed Oct 9, 2024
1 parent 2bdcdbf commit 0ca309c
Showing 1 changed file with 32 additions and 62 deletions.
94 changes: 32 additions & 62 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,68 +5,6 @@ on:
push:

jobs:
cabal:
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
ghc:
# - "8.6.5"
# - "8.8.4"
# - "8.10.7"
# - "9.0.2"
# - "9.2.8"
- "9.4.8"
- "9.6.6"
- "9.8.2"
# exclude:
# - os: windows-latest
# ghc: 9.0.2
# - os: windows-latest
# ghc: 9.2.8

steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v27
if: runner.os != 'Windows'
with:
# release-24.05
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/74435c9234c751e6786c5f3fd34ff6b0f0c13bd1.tar.gz

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libpcre3-dev
- uses: haskell-actions/setup@v2
id: setup-haskell-cabal
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: "latest"

- name: Freeze
run: |
cabal freeze
- uses: actions/cache/restore@v4
id: cache-restore
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}

- name: Build
run: |
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
cabal build all
- name: Test
run: |
cabal test all
stack:
name: stack / ghc ${{ matrix.ghc }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -117,3 +55,35 @@ jobs:
with:
path: ~/.stack
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.yaml }}-stack

nix-normal:
name: nix build .#normal
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v27
with:
# release-24.05
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/74435c9234c751e6786c5f3fd34ff6b0f0c13bd1.tar.gz

- uses: DeterminateSystems/magic-nix-cache-action@v8
- name: Build
run: nix build .#normal

nix-static:
name: nix build .#static
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v27
with:
# release-24.05
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/74435c9234c751e6786c5f3fd34ff6b0f0c13bd1.tar.gz

- uses: DeterminateSystems/magic-nix-cache-action@v8
- name: Build
run: nix build .#static

0 comments on commit 0ca309c

Please sign in to comment.