hello/.github/workflows/main.yml

81 lines
2.1 KiB
YAML
Raw Normal View History

2023-09-15 17:54:20 +00:00
name: "Hello"
on:
push:
branches: [ main, master ]
pull_request:
types: [opened, reopened, synchronize]
permissions:
contents: read
issues: write
2023-09-19 20:37:58 +00:00
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
2023-09-15 17:54:20 +00:00
env:
GIT_BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_SHA: ${{ github.sha }}
jobs:
2023-09-19 20:37:58 +00:00
nix-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
- id: set-matrix
name: Generate Nix Matrix
run: |
set -Eeu
echo "matrix=$(nix eval --json '.#githubActions.matrix')" >> "$GITHUB_OUTPUT"
2023-09-15 17:54:20 +00:00
nix-build:
needs: nix-matrix
2023-09-19 20:37:58 +00:00
name: Build on ${{ matrix.attr }}
2023-09-15 17:54:20 +00:00
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
steps:
- uses: cachix/install-nix-action@v22
2023-09-19 20:37:58 +00:00
- uses: actions/checkout@v3
2023-09-15 17:54:20 +00:00
- run: nix build -L ".#${{ matrix.attr }}"
# runs-on: ubuntu-latest
# name: Build on ${{ matrix.distro }} (${{ matrix.version }}) for ${{ matrix.arch }}
# # strategy:
# # matrix:
# # include:
# # - arch: x86_64
# # distro: Debian
# # version: bullseye
# # - arch: aarch64
# # distro: Debian
# # version: bullseye
# # - arch: ppc64le
# # distro: Debian
# # version: bullseye
# # - arch: risc64
# # distro: Ubuntu
# # version: ubuntu_latest
# steps:
# - uses: actions/checkout@v3
# - uses: cachix/install-nix-action@v22
# with:
# github_access_token: ${{ secrets.GITHUB_TOKEN }}
# - run: nix build -L
# - run: nix flake check
# nix-build:
# needs: nix-matrix
# runs-on: ${{ matrix.os }}
# strategy:
# matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
# steps:
# - uses: actions/checkout@v3
# - uses: cachix/install-nix-action@v22
# - run: nix build -L ".#${{ matrix.attr }}"