Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

env:
CACHE_VERSION: v0
TERM: dumb

concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
ghc-version: ['ghc910', 'ghc984', 'ghc966']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install nix
uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
accept-flake-config = true
download-buffer-size = 512000000

- name: Cache nix
uses: cachix/cachix-action@v14
with:
name: gogol
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

# There isn't any apparent sensible way to cache stack, so this more or less
# follows the imperfect ideas in https://github.com/commercialhaskell/stack/issues/5754

- name: Cache ~/.stack
uses: actions/cache@v4
with:
key: stack-${{ runner.os }}-${{ matrix.ghc-version }}-${{ env.CACHE_VERSION }}-${{ hashFiles('stack-${{ matrix.ghc-version }}.yaml', '**/*.cabal') }}
restore-keys: |
stack-${{ runner.os }}-${{ matrix.ghc-version }}-${{ env.CACHE_VERSION }}-
path: |
~/.stack

- name: Cache .stack-work
uses: actions/cache@v4
with:
key: stack-work-${{ runner.os }}-${{ matrix.ghc-version }}-${{ env.CACHE_VERSION }}-${{ hashFiles('stack-${{ matrix.ghc-version }}.yaml', '**/*.cabal') }}-${{ hashFiles('lib/**/*.hs') }}
restore-keys: |
stack-work-${{ runner.os }}-${{ matrix.ghc-version }}-${{ env.CACHE_VERSION }}-${{ hashFiles('stack-${{ matrix.ghc-version }}.yaml', '**/*.cabal') }}-
stack-work-${{ runner.os }}-${{ matrix.ghc-version }}-${{ env.CACHE_VERSION }}-
path: |
.stack-work
**/.stack-work

- name: Free disk space
run: |
sudo rm -rf /opt/hostedtoolcache /opt/ghc /usr/share/dotnet /usr/local/lib/android
sudo df --human-readable
sudo free --human
sudo swapon --show

- name: Build dependencies
run: |
nix develop .#${{ matrix.ghc-version }} --print-build-logs --command stack build --only-dependencies

- name: Build libraries
run: |
nix develop .#${{ matrix.ghc-version }} --print-build-logs --command stack build gogol gogol-core

- name: Build generator
if: matrix.ghc-version == 'ghc910'
run: |
nix develop .#${{ matrix.ghc-version }} --print-build-logs --command stack build ./gen

- name: Build services
run: |
nix develop .#${{ matrix.ghc-version }} --print-build-logs --command stack build ./lib/services
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Gogol

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

* [Description](#description)
Expand Down
71 changes: 5 additions & 66 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading