commit aaa8bc62f313f3bdacbf67dd1910977b30d0d36a parent 17232705dabfa84f80fd666ccb4ab1acef16977a Author: Nikolay Korotkiy <sikmir@gmail.com> Date: Mon, 21 Sep 2020 13:37:03 +0300 CI: switch from Travis to GitHub Actions Diffstat:
A | .github/workflows/build.yml | | | 37 | +++++++++++++++++++++++++++++++++++++ |
D | .travis.yml | | | 54 | ------------------------------------------------------ |
2 files changed, 37 insertions(+), 54 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml @@ -0,0 +1,37 @@ +name: "Build and populate cache" +on: + pull_request: + push: + schedule: + - cron: '51 2 * * *' +jobs: + tests: + strategy: + matrix: + nurRepo: + - sikmir + cachixName: + - sikmir + nixPath: + - nixpkgs=channel:nixos-unstable + - nixpkgs=channel:nixpkgs-unstable + - nixpkgs=channel:nixos-20.09 + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2.3.2 + - name: Install nix + uses: cachix/install-nix-action@v10 + with: + nix_path: "${{ matrix.nixPath }}" + - name: Show nixpkgs version + run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version' + - name: Setup cachix + uses: cachix/cachix-action@v6 + with: + name: ${{ matrix.cachixName }} + signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' + - name: Build nix packages + run: nix run -I 'nixpkgs=channel:nixos-unstable' nixpkgs.nix-build-uncached -c nix-build-uncached ci.nix -A cacheOutputs + - name: Trigger NUR update + run: curl -XPOST "https://nur-update.herokuapp.com/update?repo=${{ matrix.nurRepo }}" diff --git a/.travis.yml b/.travis.yml @@ -1,54 +0,0 @@ -language: nix -nix: 2.3.7 - -env: - global: - - CACHIX_CACHE=sikmir - - NUR_REPO=sikmir - -jobs: - include: - - env: NIX_CHANNEL=https://nixos.org/channels/nixpkgs-unstable - os: linux - - env: NIX_CHANNEL=https://nixos.org/channels/nixos-unstable - os: linux - - env: NIX_CHANNEL=https://nixos.org/channels/nixos-20.09 - os: linux - - env: NIX_CHANNEL=https://nixos.org/channels/nixpkgs-unstable - os: osx - allow_failures: - - env: NIX_CHANNEL=https://nixos.org/channels/nixpkgs-unstable - os: osx - -cache: - directories: - - $HOME/nix.store - -before_cache: - - mkdir -p $HOME/nix.store - - nix copy --to file://$HOME/nix.store - -before_install: - - sudo mkdir -p /etc/nix - - echo "trusted-users = root $USER" | sudo tee -a /etc/nix/nix.conf - - echo 'require-sigs = false' | sudo tee -a /etc/nix/nix.conf > /dev/null - - echo "substituters = https://cache.nixos.org/ https://${CACHIX_CACHE}.cachix.org https://cachix.cachix.org file://$HOME/nix.store" | sudo tee -a /etc/nix/nix.conf > /dev/null - -install: - - nix --version - - if [ -n "${CACHIX_CACHE}" ]; then travis_retry nix-channel --update; fi - - if [ -n "${CACHIX_CACHE}" ]; then nix-env -iA cachix -f https://cachix.org/api/v1/install; fi - - if [ -n "${CACHIX_CACHE}" ]; then cachix use "${CACHIX_CACHE}"; fi - - nix-channel --add "${NIX_CHANNEL}" nixpkgs - - travis_retry nix-channel --update - -script: - - nix-build ci.nix -A buildOutputs - - nix eval -f default.nix 'lib' - - nix eval -f default.nix 'modules' - - nix eval -f default.nix 'overlays' - -after_success: - - if [ -n "${CACHIX_CACHE}" ]; then nix-build ci.nix -A cacheOutputs | cachix push "${CACHIX_CACHE}"; fi - - if [ "false" = "${TRAVIS_PULL_REQUEST}" -a "master" = "${TRAVIS_BRANCH}" ]; then - curl -XPOST "https://nur-update.herokuapp.com/update?repo=${NUR_REPO}"; fi