Avoid changing system-wide SSH config on runners #325
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
release: | |
runs-on: ubuntu-22.04 | |
if: always() | |
needs: | |
- install-with-nix-quick-install-action | |
- install-with-install-nix-action | |
- test-build | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: nixbuild/nix-quick-install-action@v29 | |
with: | |
nix_conf: experimental-features = nix-command flakes | |
- uses: ./ | |
with: | |
nixbuild_token: ${{ secrets.nixbuild_token }} | |
generate_summary_for: 'workflow' | |
- name: Build release script | |
run: nix build .#packages.x86_64-linux.release | |
- name: Verify build signature | |
run: test "$(nix path-info ./result --json | jq -r '.[].signatures[0]' | sed 's/:.*//')" = "nixbuild.net/rickard-1" | |
- name: Release if needed | |
if: github.ref == 'refs/heads/master' | |
run: ./result ${{steps.nix-archives.outputs.download-path}} ./RELEASE | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
test-build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-22.04, macos-13, macos-14 ] | |
system: [ x86_64-linux ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: nixbuild/nix-quick-install-action@v29 | |
with: | |
nix_conf: experimental-features = nix-command flakes | |
- uses: ./ | |
with: | |
nixbuild_token: ${{ secrets.nixbuild_token }} | |
generate_summary_for: 'job' | |
keep-builds-running: true # test that we can set a setting | |
- name: Run a test build | |
run: | | |
cat flake.nix | sed "s/__SIMPLE_TEST_BUILD__/$RANDOM$RANDOM$RANDOM$RANDOM/" > flake.nix.new | |
mv flake.nix.new flake.nix | |
nix build --system ${{ matrix.system }} .#simple-test-build | |
- name: Verify build signature | |
run: test "$(nix path-info ./result --json | jq -r '.[].signatures[0]' | sed 's/:.*//')" = "nixbuild.net/rickard-1" | |
install-with-nix-quick-install-action: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-22.04, macos-13, macos-14 ] | |
nix_version: | |
- 2.24.9 | |
- 2.23.3 | |
- 2.22.3 | |
- 2.21.4 | |
- 2.20.8 | |
- 2.19.6 | |
- 2.18.8 | |
- 2.3.18 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: nixbuild/nix-quick-install-action@v29 | |
with: | |
nix_version: ${{ matrix.nix_version }} | |
- uses: ./ | |
with: | |
nixbuild_token: ${{ secrets.nixbuild_token }} | |
keep-builds-running: true # test that we can set a setting | |
install-with-install-nix-action: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-22.04, macos-13, macos-14 ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cachix/install-nix-action@v30 | |
- uses: ./ | |
with: | |
nixbuild_token: ${{ secrets.nixbuild_token }} | |
keep-builds-running: true # test that we can set a setting |