ci: update github workflows

This commit is contained in:
Tobias Happ 2022-09-03 17:07:52 +02:00
parent c170d27234
commit 7474a703ea
2 changed files with 41 additions and 31 deletions

View file

@ -1,17 +1,25 @@
name: "Build ci.nix and push to cachix" name: Build ci.nix and push to cachix
on: on:
pull_request: pull_request:
push: push:
jobs: jobs:
cachix: cachix:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2.3.4 - name: Checkout repository
- uses: cachix/install-nix-action@v13 uses: actions/checkout@v3
with:
nix_path: nixpkgs=channel:nixos-22.05 - name: Install nix
- uses: cachix/cachix-action@v10 uses: cachix/install-nix-action@v17
with: with:
name: nix-on-droid nix_path: nixpkgs=channel:nixos-22.05
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: nix-build ci.nix - name: Setup cachix
uses: cachix/cachix-action@v10
with:
name: nix-on-droid
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
- name: Build ci.nix
run: nix-build ci.nix

View file

@ -1,4 +1,4 @@
name: 'run on-device-tests with fakedroid' name: Run on-device-tests with fakedroid
on: on:
pull_request: pull_request:
push: push:
@ -7,28 +7,30 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/checkout@v2.4.0 - name: Install nix
uses: cachix/install-nix-action@v17
with:
nix_path: nixpkgs=channel:nixos-22.05
extra_nix_config: "experimental-features = nix-command"
- uses: cachix/install-nix-action@v15 - name: Setup cachix
with: uses: cachix/cachix-action@v10
nix_path: nixpkgs=channel:nixos-22.05 with:
extra_nix_config: "experimental-features = nix-command" name: nix-on-droid
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
- uses: cachix/cachix-action@v10 - name: Initialize fakedroid
with: run: tests/fakedroid.sh echo INIT
name: nix-on-droid
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- name: init - name: Run tests
run: tests/fakedroid.sh echo INIT run: |
tests/fakedroid.sh mkdir -p .cache/nix-on-droid-self-test
tests/fakedroid.sh touch .cache/nix-on-droid-self-test/confirmation-granted
tests/fakedroid.sh nix-on-droid on-device-test
- name: test - name: Push to cachix
run: | if: always() && github.event_name != 'pull_request'
tests/fakedroid.sh mkdir -p .cache/nix-on-droid-self-test run: tests/fakedroid.sh nix-shell -p cachix --run 'nix --extra-experimental-features nix-command path-info --all | cachix push nix-on-droid'
tests/fakedroid.sh touch .cache/nix-on-droid-self-test/confirmation-granted
tests/fakedroid.sh nix-on-droid on-device-test
- name: upload
if: always() && github.event_name != 'pull_request'
run: tests/fakedroid.sh nix-shell -p cachix --run 'nix --extra-experimental-features nix-command path-info --all | cachix push nix-on-droid'