rework CI

This commit is contained in:
Domen Kožar 2020-05-12 10:59:39 +02:00
commit 6a2b9a1715
No known key found for this signature in database
GPG key ID: C2FFBCAFD2C24246
2 changed files with 28 additions and 20 deletions

View file

@ -4,45 +4,53 @@ on:
push: push:
jobs: jobs:
tests: public-cache:
strategy: strategy:
matrix: matrix:
os: [ubuntu-18.04, macos] os: [ubuntu-18.04, macos]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
- run: yarn install --frozen-lockfile - run: yarn install --frozen-lockfile
- run: yarn build - run: yarn build
- run: yarn test
- uses: cachix/install-nix-action@v8 - uses: cachix/install-nix-action@v8
- name: Test public cache - name: Test public cache
uses: ./ uses: ./
with: with:
name: cachix-action name: cachix-action
file: test.nix
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: nix-build test.nix
public-cache-no-signing-key:
strategy:
matrix:
os: [ubuntu-18.04, macos]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- run: yarn install --frozen-lockfile
- run: yarn build
- uses: cachix/install-nix-action@v8
- name: Test public cache no signing key - name: Test public cache no signing key
uses: ./ uses: ./
with: with:
name: cachix-action name: cachix-action
file: test.nix - run: nix-build test.nix
signingKey: ''
- name: Test public cache no pushing private-cache:
uses: ./ strategy:
with: matrix:
name: cachix-action os: [ubuntu-18.04, macos]
skipNixBuild: true runs-on: ${{ matrix.os }}
- name: Test nixBuildArgs parameter steps:
uses: ./ - uses: actions/checkout@v2
with: - run: yarn install --frozen-lockfile
name: cachix-action - run: yarn build
file: test-with-arg.nix - uses: cachix/install-nix-action@v8
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
nixBuildArgs: --argstr arg foobar
- name: Test private cache - name: Test private cache
uses: ./ uses: ./
with: with:
name: cachix-action-private name: cachix-action-private
file: test.nix
signingKey: '${{ secrets.CACHIX_SIGNING_KEY_PRIVATE }}' signingKey: '${{ secrets.CACHIX_SIGNING_KEY_PRIVATE }}'
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix-build test.nix

View file

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
comm -13 <(sort /tmp/store-path-pre-build) <(nix path-info --all | grep -v '\.drv$') | $1 push $2 comm -13 <(sort /tmp/store-path-pre-build) <(nix path-info --all | grep -v '\.drv$' | sort) | $1 push -j8 $2