From e482aa9e63ec8846ab541aad8919a68fccfd7bc3 Mon Sep 17 00:00:00 2001 From: Mykhailo Nikiforov Date: Mon, 25 Mar 2024 09:43:46 +0200 Subject: [PATCH] feat: add check-flake ci --- .gitea/workflows/check-flake.yml | 27 +++++++++++++++++++ .gitea/workflows/update-flake-lock.yml | 37 -------------------------- 2 files changed, 27 insertions(+), 37 deletions(-) create mode 100644 .gitea/workflows/check-flake.yml delete mode 100644 .gitea/workflows/update-flake-lock.yml diff --git a/.gitea/workflows/check-flake.yml b/.gitea/workflows/check-flake.yml new file mode 100644 index 0000000..dc91d6c --- /dev/null +++ b/.gitea/workflows/check-flake.yml @@ -0,0 +1,27 @@ +name: check-flake +on: + push: + branches: + - main + pull_request: + +jobs: + lockfile: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: "main" + - name: Setup sudo (required for the next step) + run: apt-get update && apt-get install -y sudo + - name: Setup nix + uses: cachix/install-nix-action@v26 + with: + github_access_token: ${{ secrets.GH_ACCESS_TOKEN }} + - name: Check nix flake + run: | + nix --extra-experimental-features nix-command --extra-experimental-features flakes flake check --all-systems + - name: Build nix flake + run: | + nix --extra-experimental-features nix-command --extra-experimental-features flakes build --no-link .# diff --git a/.gitea/workflows/update-flake-lock.yml b/.gitea/workflows/update-flake-lock.yml deleted file mode 100644 index d59ad62..0000000 --- a/.gitea/workflows/update-flake-lock.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: update-flake-lock -on: - schedule: - - cron: "0 1 0 * *" - -jobs: - lockfile: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - ref: "main" - - name: Setup sudo (required for the next step) - run: apt-get update && apt-get install -y sudo - - name: Setup nix - uses: cachix/install-nix-action@v26 - with: - github_access_token: ${{ secrets.GH_ACCESS_TOKEN }} - - name: Update nix flake lockfile - run: | - nix --extra-experimental-features nix-command --extra-experimental-features flakes flake update - - name: Verify Changed files - uses: tj-actions/verify-changed-files@v19 - id: verify-changed-files - with: - files: | - flake.lock - - name: Push updated lockfile - if: steps.verify-changed-files.outputs.files_changed == 'true' - run: | - git diff - git config --global user.name "Gitea Bot" - git config --global user.email "bot@git.palkoi.net" - git add flake.lock - git commit -m 'choke(nix-lock): bump flake.lock versions' - git push