Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate to GitHub actions for haskell-libraries ci #110

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
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
Loading