mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-16 20:24:31 +02:00
ci/check: split build into reusable workflow
This commit is contained in:
parent
fd44fb9264
commit
f94d952820
2 changed files with 60 additions and 30 deletions
51
.github/workflows/build.yml
vendored
Normal file
51
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
name:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
system:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
os:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
attr:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
timeout:
|
||||||
|
required: false
|
||||||
|
type: number
|
||||||
|
default: 60
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: ${{ inputs.name }}
|
||||||
|
runs-on: ${{ inputs.os }}
|
||||||
|
timeout-minutes: ${{ inputs.timeout }}
|
||||||
|
steps:
|
||||||
|
- name: Free disk space
|
||||||
|
if: endsWith( '-linux', inputs.system )
|
||||||
|
uses: wimpysworld/nothing-but-nix@main
|
||||||
|
with:
|
||||||
|
# Options: holster, carve, cleave (default), rampage
|
||||||
|
hatchet-protocol: rampage
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Install nix
|
||||||
|
uses: cachix/install-nix-action@v31
|
||||||
|
- name: Setup nix cache
|
||||||
|
uses: cachix/cachix-action@v16
|
||||||
|
with:
|
||||||
|
name: nix-community
|
||||||
|
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||||
|
- name: Build ${{ inputs.attr }}
|
||||||
|
env:
|
||||||
|
attr: ${{ inputs.attr }}
|
||||||
|
run: |
|
||||||
|
nix build ".#$attr" \
|
||||||
|
--abort-on-warn \
|
||||||
|
--print-build-logs \
|
||||||
|
--log-format raw
|
39
.github/workflows/check.yml
vendored
39
.github/workflows/check.yml
vendored
|
@ -14,7 +14,7 @@ on:
|
||||||
- "LICENSE"
|
- "LICENSE"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-matrix:
|
prepare:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
|
@ -31,35 +31,14 @@ jobs:
|
||||||
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
|
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: ${{ matrix.name }} (${{ matrix.system }})
|
uses: ./.github/workflows/build.yml
|
||||||
needs:
|
needs:
|
||||||
- build-matrix
|
- prepare
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix: ${{ fromJSON(needs.build-matrix.outputs.matrix) }}
|
matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }}
|
||||||
timeout-minutes: 20
|
with:
|
||||||
steps:
|
name: ${{ matrix.name }} (${{ matrix.system }})
|
||||||
- name: Free disk space
|
system: ${{ matrix.system }}
|
||||||
if: endsWith( '-linux', matrix.system )
|
os: ${{ matrix.os }}
|
||||||
uses: wimpysworld/nothing-but-nix@main
|
attr: ${{ matrix.attr }}
|
||||||
with:
|
|
||||||
# Options: holster, carve, cleave (default), rampage
|
|
||||||
hatchet-protocol: rampage
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Install nix
|
|
||||||
uses: cachix/install-nix-action@v31
|
|
||||||
- name: Setup nix cache
|
|
||||||
uses: cachix/cachix-action@v16
|
|
||||||
with:
|
|
||||||
name: nix-community
|
|
||||||
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
|
||||||
- name: Build ${{ matrix.attr }}
|
|
||||||
env:
|
|
||||||
attr: ${{ matrix.attr }}
|
|
||||||
run: |
|
|
||||||
nix build ".#$attr" \
|
|
||||||
--abort-on-warn \
|
|
||||||
--print-build-logs \
|
|
||||||
--log-format raw
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue