From 7474a703eaeb489d1a4e4644e778817b7ed04fbf Mon Sep 17 00:00:00 2001 From: Tobias Happ Date: Sat, 3 Sep 2022 17:07:52 +0200 Subject: [PATCH] ci: update github workflows --- .github/workflows/cachix.yml | 28 +++++++++++------- .github/workflows/fakedroid-odt.yml | 44 +++++++++++++++-------------- 2 files changed, 41 insertions(+), 31 deletions(-) diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml index c215bec..b0ac82a 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/cachix.yml @@ -1,17 +1,25 @@ -name: "Build ci.nix and push to cachix" +name: Build ci.nix and push to cachix on: pull_request: push: jobs: cachix: runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v2.3.4 - - uses: cachix/install-nix-action@v13 - with: - nix_path: nixpkgs=channel:nixos-22.05 - - uses: cachix/cachix-action@v10 - with: - name: nix-on-droid - signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' - - run: nix-build ci.nix + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install nix + uses: cachix/install-nix-action@v17 + with: + nix_path: nixpkgs=channel:nixos-22.05 + + - 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 diff --git a/.github/workflows/fakedroid-odt.yml b/.github/workflows/fakedroid-odt.yml index cf61001..bb9f2dc 100644 --- a/.github/workflows/fakedroid-odt.yml +++ b/.github/workflows/fakedroid-odt.yml @@ -1,4 +1,4 @@ -name: 'run on-device-tests with fakedroid' +name: Run on-device-tests with fakedroid on: pull_request: push: @@ -7,28 +7,30 @@ jobs: runs-on: ubuntu-latest 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 - with: - nix_path: nixpkgs=channel:nixos-22.05 - extra_nix_config: "experimental-features = nix-command" + - name: Setup cachix + uses: cachix/cachix-action@v10 + with: + name: nix-on-droid + signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" - - uses: cachix/cachix-action@v10 - with: - name: nix-on-droid - signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' + - name: Initialize fakedroid + run: tests/fakedroid.sh echo INIT - - name: init - run: tests/fakedroid.sh echo INIT + - name: Run tests + 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 - 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: 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' + - name: Push to cachix + 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'