From 8d8774e0850ea60f07499182f1cccee29767b79e Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Wed, 25 Aug 2021 14:06:28 -0500 Subject: [PATCH] use GH actions instead of Travis --- .github/workflows/ci.yml | 21 ++++++++++++++++ .travis.yml | 54 ---------------------------------------- 2 files changed, 21 insertions(+), 54 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..d156388b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,21 @@ +name: CI + +on: + pull_request: + push: + +jobs: + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: cachix/install-nix-action@v13 + + # - uses: cachix/cachix-action@v10 + # with: + # name: noredink-ui + # authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + # extraPullNames: niv + + - run: nix-shell --pure --run 'shake --verbose ci' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0528eaa1..00000000 --- a/.travis.yml +++ /dev/null @@ -1,54 +0,0 @@ -language: nix - -env: - global: - - CACHIX_CACHE=noredink-ui - -cache: - directories: - - node_modules - - ~/.elm - -install: - # This setup script comes from the cachix docs[1], but we annotate it here so - # it's easier to maintain. - # - # [1]: https://docs.cachix.org/continuous-integration-setup/travis-ci.html - - # First, we need to tell Nix that the current user is trusted to make changes to - # the system configuration, so that we can do exactly that in the next step. - - echo "trusted-users = $USER" | sudo tee -a /etc/nix/nix.conf - - sudo systemctl restart nix-daemon - - # Next, we need to tell Nix to use our cache to avoid building fresh every time. - # Under the covers, this means trusting the signing key and adding the - # our-cache-name.cachix.org as a substituter. But we don't really need to worry - # a lot about the mechanism here, since the `cachix use` statement here will - # take care of everything for us if it has the right permissions. - - nix-env -iA nixpkgs.cachix - - cachix use $CACHIX_CACHE - - # Next, we list all the paths that Nix currently knows about so that we don't - # waste time trying to push them later. - - nix path-info --all > /tmp/store-path-pre-build - - # Finally, we run `nix-shell` with a no-op command to download our real - # dependencies. This step should now take advantage of the cachix cache and - # avoid rebuilding any upstream software we depend on! (At the time of this - # writing, that measn we avoid compiling `niv` and `elm-forbid-import` on every - # run.) - # - # Note that this step is technically not necessary--running our build command in - # `nix-shell` below would also take care of this--but getting dependencies here - # lets us collapse the (huge) download list in the Travis UI. - - nix-shell --run 'true' - -script: - - nix-shell --pure --run 'shake --verbose ci' - -after_success: - # After we successfully build, we want to cache whatever we can. That means that - # when dependencies change, we should only build them once. The invocation below - # just gets the difference between the derivations we had before the build and - # the derivations we have now, and pushes the new ones. - - comm -13 <(sort /tmp/store-path-pre-build | grep -v '\.drv$') <(nix path-info --all | grep -v '\.drv$' | sort) | cachix push $CACHIX_CACHE