Skip to content

Commit

Permalink
fix: Update flake inputs CI workflow pipe exit status
Browse files Browse the repository at this point in the history
  • Loading branch information
lpchaim committed Oct 5, 2024
1 parent 10d71f1 commit 9c9f1c1
Showing 1 changed file with 16 additions and 45 deletions.
61 changes: 16 additions & 45 deletions .github/workflows/update-flake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
cachixAuthToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
system: aarch64-linux
- name: Update flake inputs
continue-on-error: true
run: |
nix flake update \
| tee --output-error /dev/tty \
1> update.stdout \
2> update.stderr
2> update.stderr \
&& exit "${PIPESTATUS[0]}"
- name: Cache flake.lock
uses: actions/[email protected]
with:
Expand All @@ -39,12 +39,6 @@ jobs:
check:
name: Run flake checks
needs: update
strategy:
matrix:
system:
- x86_64-linux
- aarch64-linux
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -53,7 +47,6 @@ jobs:
with:
cachixAuthToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
forceInstallQemu: true
system: ${{ matrix.system }}
- name: Restore cached flake.lock
uses: actions/cache/[email protected]
with:
Expand All @@ -63,15 +56,16 @@ jobs:
run: |
nix flake check \
| tee --output-error /dev/tty \
1> check-${{ matrix.system }}.stdout \
2> check-${{ matrix.system }}.stderr
1> check.stdout \
2> check.stderr \
&& exit "${PIPESTATUS[0]}"
- name: Cache check results
uses: actions/[email protected]
with:
path: |
check-${{ matrix.system }}.stdout
check-${{ matrix.system }}.stderr
key: check-${ matrix.system }-${{ github.sha }}
check.stdout
check.stderr
key: check-${{ github.sha }}

create-pr:
name: Create PR
Expand All @@ -87,30 +81,21 @@ jobs:
update.stdout
update.stderr
key: update-${{ github.sha }}
- name: Restore cached x86_64-linux test results
- name: Restore cached test results
uses: actions/cache/[email protected]
with:
path: |
check-x86_64-linux.stdout
check-x86_64-linux.stderr
key: check-x86_64-linux-${{ github.sha }}
- name: Restore cached aarch64-linux test results
uses: actions/cache/[email protected]
with:
path: |
check-aarch64-linux.stdout
check-aarch64-linux.stderr
key: check-aarch64-linux-${{ github.sha }}
check.stdout
check.stderr
key: check-${{ github.sha }}
- name: Set variables
id: vars
run: |
{
echo "update-stdout=$(cat update.stdout)"
echo "update-stderr=$(cat update.stderr)"
echo "check-x86_64-linux-stdout=$(cat check-x86_64-linux.stdout)"
echo "check-x86_64-linux-stderr=$(cat check-x86_64-linux.stderr)"
echo "check-aarch64-linux-stdout=$(cat check-aarch64-linux.stdout)"
echo "check-aarch64-linux-stderr=$(cat check-aarch64-linux.stderr)"
echo "check-stdout=$(cat check.stdout)"
echo "check-stderr=$(cat check.stderr)"
} > "$GITHUB_OUTPUT"
- name: Create PR
uses: technote-space/create-pr-action@v2
Expand All @@ -129,27 +114,13 @@ jobs:
### Check results
#### x86_64-linux
```sh
${{ steps.vars.outputs.check-x86_64-linux-stdout }}
${{ steps.vars.outputs.check-stdout }}
```
<details>
<summary>Warnings</summary>
```sh
${{ steps.vars.outputs.check-x86_64-linux-stderr }}
```
</details>
#### aarch64-linux
```sh
${{ steps.vars.outputs.check-aarch64-linux-stdout }}
```
<details>
<summary>Warnings</summary>
```sh
${{ steps.vars.outputs.check-aarch64-linux-stderr }}
```
</details>
${{ steps.vars.outputs.check-stderr }}
```
</details>
GITHUB_TOKEN: ${{ secrets.GHA_TOKEN }}

0 comments on commit 9c9f1c1

Please sign in to comment.