Skip to content

Commit 54fe41a

Browse files
authored
Add nix develop based CI workflow (#211)
* Add nix develop based CI workflow * Generate compiler-named stack lockfiles * Remove direnv logging prefix
1 parent 02afaab commit 54fe41a

File tree

13 files changed

+258
-479
lines changed

13 files changed

+258
-479
lines changed

.github/workflows/ci.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CACHE_VERSION: v0
11+
TERM: dumb
12+
13+
concurrency:
14+
group: build-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
ghc-version: ['ghc910', 'ghc984', 'ghc966']
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Install nix
29+
uses: DeterminateSystems/nix-installer-action@main
30+
with:
31+
extra-conf: |
32+
accept-flake-config = true
33+
download-buffer-size = 512000000
34+
35+
- name: Cache nix
36+
uses: cachix/cachix-action@v14
37+
with:
38+
name: gogol
39+
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
40+
41+
# There isn't any apparent sensible way to cache stack, so this more or less
42+
# follows the imperfect ideas in https://github.com/commercialhaskell/stack/issues/5754
43+
44+
- name: Cache ~/.stack
45+
uses: actions/cache@v4
46+
with:
47+
key: stack-${{ runner.os }}-${{ matrix.ghc-version }}-${{ env.CACHE_VERSION }}-${{ hashFiles('stack-${{ matrix.ghc-version }}.yaml', '**/*.cabal') }}
48+
restore-keys: |
49+
stack-${{ runner.os }}-${{ matrix.ghc-version }}-${{ env.CACHE_VERSION }}-
50+
path: |
51+
~/.stack
52+
53+
- name: Cache .stack-work
54+
uses: actions/cache@v4
55+
with:
56+
key: stack-work-${{ runner.os }}-${{ matrix.ghc-version }}-${{ env.CACHE_VERSION }}-${{ hashFiles('stack-${{ matrix.ghc-version }}.yaml', '**/*.cabal') }}-${{ hashFiles('lib/**/*.hs') }}
57+
restore-keys: |
58+
stack-work-${{ runner.os }}-${{ matrix.ghc-version }}-${{ env.CACHE_VERSION }}-${{ hashFiles('stack-${{ matrix.ghc-version }}.yaml', '**/*.cabal') }}-
59+
stack-work-${{ runner.os }}-${{ matrix.ghc-version }}-${{ env.CACHE_VERSION }}-
60+
path: |
61+
.stack-work
62+
**/.stack-work
63+
64+
- name: Free disk space
65+
run: |
66+
sudo rm -rf /opt/hostedtoolcache /opt/ghc /usr/share/dotnet /usr/local/lib/android
67+
sudo df --human-readable
68+
sudo free --human
69+
sudo swapon --show
70+
71+
- name: Build dependencies
72+
run: |
73+
nix develop .#${{ matrix.ghc-version }} --print-build-logs --command stack build --only-dependencies
74+
75+
- name: Build libraries
76+
run: |
77+
nix develop .#${{ matrix.ghc-version }} --print-build-logs --command stack build gogol gogol-core
78+
79+
- name: Build generator
80+
if: matrix.ghc-version == 'ghc910'
81+
run: |
82+
nix develop .#${{ matrix.ghc-version }} --print-build-logs --command stack build ./gen
83+
84+
- name: Build services
85+
run: |
86+
nix develop .#${{ matrix.ghc-version }} --print-build-logs --command stack build ./lib/services

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Gogol
22

3-
![CI](https://github.com/brendanhay/gogol/actions/workflows/haskell.yml/badge.svg)
3+
![CI](https://github.com/brendanhay/gogol/actions/workflows/ci.yml/badge.svg)
44
[![Hackage Version](https://img.shields.io/hackage/v/gogol.svg)](http://hackage.haskell.org/package/gogol)
55

66
* [Description](#description)

flake.lock

Lines changed: 5 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)