From 1212f8e61aa384f4343cd5fe90de182638588536 Mon Sep 17 00:00:00 2001 From: Jinnah Ali-Clarke Date: Tue, 28 May 2024 12:40:02 -0400 Subject: [PATCH 1/3] update readme re: ghc versions we test against --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index abe3b8a3..3439b823 100644 --- a/README.md +++ b/README.md @@ -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. From ab31b8dd8230bf119771e2accaead1adb628caf5 Mon Sep 17 00:00:00 2001 From: Jinnah Ali-Clarke Date: Tue, 28 May 2024 12:50:09 -0400 Subject: [PATCH 2/3] add github-actions-based ci --- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..a860e5fe --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 '' -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" From 1c688cf6dcb0127b3ea5aede0eeb49b7796cfdd4 Mon Sep 17 00:00:00 2001 From: Jinnah Ali-Clarke Date: Tue, 28 May 2024 13:05:24 -0400 Subject: [PATCH 3/3] rm .travis.yml --- .travis.yml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1dd79c82..00000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: nix -nix: 2.17.0 -os: linux -dist: xenial -vm: - # we were getting out of memory errors without this - size: large -env: - global: - - PGPORT=8088 - - CACHIX_CACHE=nri - jobs: - - GHC_VERSION=8-10 - - GHC_VERSION=9-2 - - GHC_VERSION=9-4 -install: - - echo "trusted-users = $USER" | sudo tee -a /etc/nix/nix.conf - - sudo systemctl restart nix-daemon - - nix-env -iA nixpkgs.cachix - - cachix use $CACHIX_CACHE -script: - - cachix watch-exec $CACHIX_CACHE -- nix-shell shell-ghc-$GHC_VERSION.nix --run "./run-tests.sh"