2024-09-05 07:32:31 +02:00
|
|
|
# SPDX-FileCopyrightText: 2024 Christina Sørensen
|
2024-03-15 09:55:00 +01:00
|
|
|
#
|
2024-09-05 07:32:31 +02:00
|
|
|
# SPDX-License-Identifier: EUPL-1.2
|
2024-03-15 09:55:00 +01:00
|
|
|
|
|
|
|
on:
|
2024-09-05 07:32:31 +02:00
|
|
|
workflow_dispatch:
|
2024-03-15 09:55:00 +01:00
|
|
|
pull_request:
|
2024-09-05 07:32:31 +02:00
|
|
|
branches: [main]
|
|
|
|
paths:
|
|
|
|
- '.github/workflows/flake.yml'
|
|
|
|
- 'src/**'
|
|
|
|
- 'Cargo.*'
|
|
|
|
- "*.toml"
|
|
|
|
- "flake.*"
|
|
|
|
- "*.nix"
|
|
|
|
- "*.rs"
|
2024-03-15 09:55:00 +01:00
|
|
|
push:
|
|
|
|
branches: [main]
|
2024-09-05 07:32:31 +02:00
|
|
|
paths:
|
|
|
|
- '.github/workflows/flake.yml'
|
|
|
|
- 'src/**'
|
|
|
|
- 'Cargo.*'
|
|
|
|
- "*.toml"
|
|
|
|
- "flake.*"
|
|
|
|
- "*.nix"
|
|
|
|
- "*.rs"
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
|
|
|
|
cancel-in-progress: true
|
2024-03-15 09:55:00 +01:00
|
|
|
jobs:
|
2024-09-05 07:32:31 +02:00
|
|
|
flake-checker:
|
|
|
|
name: Flake Checker
|
2024-03-15 09:55:00 +01:00
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Check Nix flake inputs
|
2024-09-05 07:32:31 +02:00
|
|
|
uses: DeterminateSystems/flake-checker-action@v8
|
|
|
|
check:
|
|
|
|
name: Check Nix Flake
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-03-15 09:55:00 +01:00
|
|
|
- name: Install Nix
|
2024-09-05 07:32:31 +02:00
|
|
|
uses: DeterminateSystems/nix-installer-action@v13
|
|
|
|
- name: Setup Nix cache
|
|
|
|
uses: DeterminateSystems/magic-nix-cache-action@main
|
2024-03-15 09:55:00 +01:00
|
|
|
- name: Nix Flake Check
|
|
|
|
run: nix flake check --all-systems
|
2024-09-05 07:32:31 +02:00
|
|
|
build:
|
|
|
|
name: Build Nix package
|
|
|
|
# if cross compilation is desired add 'aarch64-linux', 'x86_64-darwin' and 'aarch64-darwin' and fix the flake to support cross compilation.
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
target: [x86_64-linux]
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Nix
|
|
|
|
uses: DeterminateSystems/nix-installer-action@v13
|
|
|
|
- name: Setup Nix cache
|
|
|
|
uses: DeterminateSystems/magic-nix-cache-action@main
|
|
|
|
- name: Nix Build
|
|
|
|
run: nix build .#packages.${{ matrix.target }}.default
|