Skip to content

Commit

Permalink
Merge pull request #110 from NoRedInk/foxen/fxn-3287-migrate-to-githu…
Browse files Browse the repository at this point in the history
…b-actions-for-haskell-libraries-ci

migrate to GitHub actions for haskell-libraries ci
  • Loading branch information
jali-clarke authored May 28, 2024
2 parents b75698e + 1c688cf commit 19ee723
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 26 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Run tests and push shell closures
on:
pull_request:
branches:
- "trunk"
push:
branches:
- "trunk"

# We also provide a way to run this manually, if needed.
workflow_dispatch:

jobs:
ci:
strategy:
matrix:
runner:
- os: macos-14 # macos sonoma on m1; 3 vcpu, 7 GB memory
base-nixpkgs-channel: nixpkgs-23.11-darwin
- os: ubuntu-22.04 # linux x86_64; 4 vcpu, 16 GB memory
base-nixpkgs-channel: nixos-23.11
ghc:
- ghc-8-10
- ghc-9-2
- ghc-9-4
runs-on: ${{ matrix.runner.os }}
steps:
- name: Install Nix
uses: cachix/install-nix-action@v26
with:
nix_path: nixpkgs=channel:${{ matrix.runner.base-nixpkgs-channel }}
extra_nix_config: |
extra-substituters = https://nri.cachix.org https://nix-script.cachix.org
trusted-public-keys = nri.cachix.org-1:9/BMj3Obc+uio3O5rYGT+egHzkBzDunAzlZZfhCGj6o= nix-script.cachix.org-1:czo3tF6XERpkDdMd6m84XjmgeHQXNeIooSt7b0560+c= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
- name: Install cachix
run: nix-env -f '<nixpkgs>' -iA cachix

- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Run tests and push shell closures
run: cachix watch-exec nri -- nix-shell shell-${{ matrix.ghc }}.nix --run "./run-tests.sh"
env:
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
PGPORT: "8088"
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ We use [Ormolu][ormolu] for code formatting.

Documentation comments use the [Haddock][haddock] format to ensure they are rendered correctly on package websites.

### Testing compilation against GHC 8.10
### Testing compilation

Our default `shell.nix` sets up an environment around GHC version 8.10. CI also runs tests against GHC 9.0. To test using this version locally:
Our default `shell.nix` sets up an environment around the most recent version of GHC that we support. CI also runs tests against a couple of older versions of GHC. To test using any of these versions locally:

```sh
cachix use nri-open-source # set up cache so the next step goes faster
nix-shell shell-ghc-9-0.nix
cachix use nri # set up cache so the next step goes faster
nix-shell shell-ghc-X-Y.nix # where X and Y correspond to any of the shells at the root of this repo
```

This starts a special shell in which you can run any of the commands above.
Expand Down

0 comments on commit 19ee723

Please sign in to comment.