mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-03 09:04:12 +02:00
update workflows
This commit is contained in:
parent
c28a81a661
commit
e1b2e97013
2 changed files with 20 additions and 56 deletions
55
.github/workflows/ci.yaml
vendored
55
.github/workflows/ci.yaml
vendored
|
|
@ -1,63 +1,26 @@
|
||||||
name: "Build"
|
name: "CI"
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: cachix/install-nix-action@v26
|
|
||||||
- uses: icewind1991/attic-action@v1
|
|
||||||
with:
|
|
||||||
name: ci
|
|
||||||
instance: https://cache.icewind.me
|
|
||||||
authToken: "${{ secrets.ATTIC_TOKEN }}"
|
|
||||||
- run: nix build .#check
|
|
||||||
|
|
||||||
clippy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: check
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: cachix/install-nix-action@v26
|
|
||||||
- uses: icewind1991/attic-action@v1
|
|
||||||
with:
|
|
||||||
name: ci
|
|
||||||
instance: https://cache.icewind.me
|
|
||||||
authToken: "${{ secrets.ATTIC_TOKEN }}"
|
|
||||||
- run: nix build .#clippy
|
|
||||||
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: check
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: cachix/install-nix-action@v26
|
|
||||||
- uses: icewind1991/attic-action@v1
|
|
||||||
with:
|
|
||||||
name: ci
|
|
||||||
instance: https://cache.icewind.me
|
|
||||||
authToken: "${{ secrets.ATTIC_TOKEN }}"
|
|
||||||
- run: nix build .#test
|
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: cachix/install-nix-action@v26
|
- uses: cachix/install-nix-action@v27
|
||||||
- id: set-matrix
|
- id: set-matrix
|
||||||
run: echo "matrix={\"target\":$(nix eval --json ".#targets")}" | tee $GITHUB_OUTPUT
|
run: echo "matrix={\"check\":$(nix eval --json '.#checks.x86_64-linux' --apply 'builtins.attrNames')}" | tee -a $GITHUB_OUTPUT
|
||||||
|
|
||||||
build:
|
checks:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [check, matrix]
|
needs: [matrix]
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix: ${{fromJson(needs.matrix.outputs.matrix)}}
|
matrix: ${{fromJson(needs.matrix.outputs.matrix)}}
|
||||||
|
name: ${{ matrix.check }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: cachix/install-nix-action@v26
|
- uses: cachix/install-nix-action@v26
|
||||||
|
|
@ -66,8 +29,4 @@ jobs:
|
||||||
name: ci
|
name: ci
|
||||||
instance: https://cache.icewind.me
|
instance: https://cache.icewind.me
|
||||||
authToken: "${{ secrets.ATTIC_TOKEN }}"
|
authToken: "${{ secrets.ATTIC_TOKEN }}"
|
||||||
- run: nix build .#${{ matrix.target }}
|
- run: nix build .#checks.x86_64-linux.${{ matrix.check }}
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: haze-${{ matrix.target }}
|
|
||||||
path: result/bin/*
|
|
||||||
|
|
|
||||||
21
.github/workflows/release.yaml
vendored
21
.github/workflows/release.yaml
vendored
|
|
@ -4,25 +4,30 @@ on:
|
||||||
release:
|
release:
|
||||||
types: [created]
|
types: [created]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
matrix:
|
matrix:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
cross-matrix: ${{ steps.set-matrix.outputs.cross-matrix }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: cachix/install-nix-action@v26
|
- uses: cachix/install-nix-action@v27
|
||||||
- id: set-matrix
|
- id: set-matrix
|
||||||
run: echo "matrix={\"target\":$(nix eval --json ".#releaseTargets")}" | tee $GITHUB_OUTPUT
|
run: |
|
||||||
|
echo "cross-matrix={\"include\":$(nix eval --json '.#lib.crossMatrix')}" | tee -a $GITHUB_OUTPUT
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: matrix
|
needs: [matrix]
|
||||||
strategy:
|
strategy:
|
||||||
matrix: ${{fromJson(needs.matrix.outputs.matrix)}}
|
fail-fast: false
|
||||||
|
matrix: ${{fromJson(needs.matrix.outputs.cross-matrix)}}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: cachix/install-nix-action@v26
|
- uses: cachix/install-nix-action@v27
|
||||||
- uses: icewind1991/attic-action@v1
|
- uses: icewind1991/attic-action@v1
|
||||||
with:
|
with:
|
||||||
name: ci
|
name: ci
|
||||||
|
|
@ -33,6 +38,6 @@ jobs:
|
||||||
uses: svenstaro/upload-release-action@v2
|
uses: svenstaro/upload-release-action@v2
|
||||||
with:
|
with:
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
file: result/bin/haze
|
file: result/bin/haze${{ matrix.binary-suffix }}
|
||||||
asset_name: haze-${{ matrix.target }}
|
asset_name: haze-${{ matrix.target }}${{ matrix.binary-suffix }}
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue