Skip to content

Build & Test

Build & Test #5

Workflow file for this run

name: "Build & Test"
on:
workflow_dispatch:
jobs:
tests:
strategy:
fail-fast: false
matrix:
os: [[self-hosted, linux, X64], [macos-latest], [self-hosted, macOS], [self-hosted, linux, ARM64]]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
repository: cachix/devenv
ref: main
- uses: cachix/install-nix-action@v26
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v14
with:
name: devenv
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
nix build
export PATH=$PWD/result/bin:$PATH
devenv --override-input nixpkgs github:cachix/devenv-nixpkgs/bump-rolling shell devenv-test-cli
devenv-run-tests --override-input nixpkgs github:cachix/devenv-nixpkgs/bump-rolling tests
generate-examples:
runs-on: [self-hosted, linux, X64]
outputs:
examples: ${{ steps.set-examples.outputs.examples }}
steps:
- name: Checkout base repo
uses: actions/checkout@v4
with:
repository: cachix/devenv
ref: main
- id: set-examples
run: |
json=$(nix shell nixpkgs#tree -c tree -J -L 1 examples | nix shell nixpkgs#jq -c jq -c '[.[0].contents[] | .name]')
echo "examples=$json" >> $GITHUB_OUTPUT
examples:
name: ${{ matrix.example }} (${{ join(matrix.os) }})
needs: [generate-examples]
strategy:
fail-fast: false
matrix:
os: [[self-hosted, linux, X64], [macos-latest], [self-hosted, macOS], [self-hosted, linux, ARM64]]
example: ${{ fromJSON(needs.generate-examples.outputs.examples) }}
runs-on: ${{ matrix.os }}
steps:
- run: sudo rm -rf /opt&
- uses: actions/checkout@v4
with:
repository: cachix/devenv
ref: main
- uses: cachix/install-nix-action@v26
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v14
with:
name: devenv
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
nix build
export PATH=$PWD/result/bin:$PATH
devenv-run-tests --override-input nixpkgs github:cachix/devenv-nixpkgs/bump-rolling --only ${{ matrix.example }} examples