diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4a5fd09..c6c49fe9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index d4847655..d1cfcf50 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -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 - 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