hello/.github/workflows/main.yml
2023-09-20 19:00:45 -04:00

55 lines
1.7 KiB
YAML

name: "Hello"
on:
push:
branches: [ main, master ]
pull_request:
types: [opened, reopened, synchronize]
permissions:
contents: read
issues: write
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
GIT_BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_SHA: ${{ github.sha }}
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
jobs:
nix-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- id: set-matrix
name: Generate Nix Matrix
run: |
set -Eeu
echo "matrix=$(nix eval --json '.#githubActions.matrix')" >> "$GITHUB_OUTPUT"
#echo 'matrix={"include":[{"attr":"githubActions.checks.x86_64-linux.hello","os":["ubuntu-22.04"]},{"attr":"githubActions.checks.x86_64-linux.lxc","os":["ubuntu-22.04"]}]}' >> "$GITHUB_OUTPUT"
#echo 'matrix={"include":[{"attr":"githubActions.checks.x86_64-linux.lxc","os":["ubuntu-22.04"]}]}' >> "$GITHUB_OUTPUT"
nix-build:
needs: nix-matrix
name: Build on ${{ matrix.attr }}
runs-on: ubuntu-latest
strategy:
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- run: nix build -L ".#${{ matrix.attr }}"