-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
7 additions
and
130 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,6 @@ | ||
name: Build and test flake outputs | ||
on: | ||
push: | ||
workflow_call: | ||
inputs: | ||
branch: | ||
description: Branch name to build on | ||
default: '' | ||
required: false | ||
type: string | ||
name: Build and test | ||
on: [ push ] | ||
|
||
jobs: | ||
nix: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
system: | ||
- x86_64 | ||
nix-command: | ||
- flake check | ||
- eval .#apps.$_system.nixos-install.program | ||
- eval .#apps.$_system.setup.program | ||
|
||
include: | ||
- nix-command: develop | ||
system: x86_64 | ||
|
||
- nix-command: build .#homeConfigurations."christian@non-nixos-vm".activationPackage | ||
system: x86_64 | ||
|
||
- nix-command: build .#homeConfigurations."demo@non-nixos-vm".activationPackage | ||
system: x86_64 | ||
|
||
- nix-command: build .#nixosConfigurations.nixos-vm.config.system.build.toplevel | ||
system: x86_64 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
|
||
- name: Install nix | ||
uses: cachix/install-nix-action@v18 | ||
|
||
- uses: cachix/cachix-action@v12 | ||
with: | ||
name: christianharke | ||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
|
||
- name: Build command (x86_64) | ||
if: matrix.system == 'x86_64' | ||
env: | ||
_system: ${{ matrix.system }}-linux | ||
run: | | ||
nix \ | ||
--verbose \ | ||
--log-format bar-with-logs \ | ||
--keep-going \ | ||
--show-trace \ | ||
${{ matrix.nix-command }} | ||
nix-ci: | ||
uses: christianharke/flake-commons/.github/workflows/nix-ci.yml@main |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,73 +4,7 @@ on: | |
- cron: 0 0 * * * | ||
|
||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
branch: ${{ steps.branch.outputs.name }} | ||
update_available: ${{ steps.commit.outputs.changes_detected }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install nix | ||
uses: cachix/install-nix-action@v18 | ||
|
||
- uses: cachix/cachix-action@v12 | ||
with: | ||
name: christianharke | ||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
|
||
- name: Update inputs | ||
run: nix flake update | ||
|
||
- name: Set branch name output | ||
id: branch | ||
run: echo "name=ci/automatic-update-$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT | ||
|
||
- name: Create branch locally | ||
run: git switch -c ${{ steps.branch.outputs.name }} | ||
|
||
- name: Commit changes | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
id: commit | ||
with: | ||
commit_author: Christian Harke <[email protected]> | ||
commit_message: "flake.inputs: automatic update" | ||
branch: ${{ steps.branch.outputs.name }} | ||
push_options: --force | ||
|
||
build: | ||
uses: christianharke/nixcfg/.github/workflows/ci.yml@master | ||
needs: update | ||
if: needs.update.outputs.update_available == 'true' | ||
nix-update: | ||
uses: christianharke/flake-commons/.github/workflows/nix-update.yml@main | ||
with: | ||
branch: ${{ needs.update.outputs.branch }} | ||
|
||
merge: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- update | ||
- build | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Check if update branch is behind master | ||
run: git diff origin/${{ needs.update.outputs.branch }}...origin/master --exit-code | ||
|
||
- name: Merge update into master | ||
run: git merge origin/${{ needs.update.outputs.branch }} | ||
|
||
- name: Push master | ||
run: git push origin master | ||
|
||
- name: Delete update branch | ||
run: git push --delete origin ${{ needs.update.outputs.branch }} | ||
base-branch: master |