From 90859f88f60b50496b2c2916ffffe5fa892c92ca Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Wed, 3 Jul 2024 17:07:40 -0400 Subject: [PATCH] github: reorg workflows and sync to codeberg and gitlab --- .github/workflows/check-flake.yml | 17 ----------- .github/workflows/check-fmt.yml | 17 ----------- .github/workflows/flake-checks.yml | 21 ++++++++++++++ ...flake-lock.yml => flake-update-inputs.yml} | 20 ++++--------- .github/workflows/git-sync-mirrors.yml | 29 +++++++++++++++++++ 5 files changed, 56 insertions(+), 48 deletions(-) delete mode 100644 .github/workflows/check-flake.yml delete mode 100644 .github/workflows/check-fmt.yml create mode 100644 .github/workflows/flake-checks.yml rename .github/workflows/{update-flake-lock.yml => flake-update-inputs.yml} (78%) create mode 100644 .github/workflows/git-sync-mirrors.yml diff --git a/.github/workflows/check-flake.yml b/.github/workflows/check-flake.yml deleted file mode 100644 index 62086c64..00000000 --- a/.github/workflows/check-flake.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: "flake: evaluation check" - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 1 - - - uses: cachix/install-nix-action@v20 - - - name: Check if flake.nix still evaluates - run: nix flake check diff --git a/.github/workflows/check-fmt.yml b/.github/workflows/check-fmt.yml deleted file mode 100644 index db497daa..00000000 --- a/.github/workflows/check-fmt.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: "flake: format check" - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - uses: cachix/install-nix-action@v20 - - - name: Check if flake complies with default style - run: nix fmt -- -c . diff --git a/.github/workflows/flake-checks.yml b/.github/workflows/flake-checks.yml new file mode 100644 index 00000000..8628d7fd --- /dev/null +++ b/.github/workflows/flake-checks.yml @@ -0,0 +1,21 @@ +name: "nix" +on: [push] +jobs: + check-format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: cachix/install-nix-action@v20 + - name: check if flake complies with default style + run: nix fmt -- -c . + check-eval: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + - uses: cachix/install-nix-action@v20 + - name: check if flake evaluates + run: nix flake check diff --git a/.github/workflows/update-flake-lock.yml b/.github/workflows/flake-update-inputs.yml similarity index 78% rename from .github/workflows/update-flake-lock.yml rename to .github/workflows/flake-update-inputs.yml index 0c5e75be..3df914c5 100644 --- a/.github/workflows/update-flake-lock.yml +++ b/.github/workflows/flake-update-inputs.yml @@ -1,36 +1,28 @@ -name: "flake.lock: update" - +name: "nix" on: schedule: - cron: "0 6 * * *" - workflow_dispatch: - jobs: - build: + update-inputs: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 with: fetch-depth: 1 - - uses: cachix/install-nix-action@v20 - - - name: Update inputs in flake.lock + - name: update inputs in flake.lock run: nix flake update - - - name: Check if flake still evaluates + - name: check if flake evaluates run: nix flake check - - uses: stefanzweifel/git-auto-commit-action@v5 with: - commit_message: "flake.lock: update" + commit_message: "flake: update inputs" branch: master commit_options: '--no-verify --signoff' file_pattern: flake.lock commit_user_name: Flake Bot # defaults to "GitHub Actions" #commit_user_email: my-github-actions-bot@example.org # defaults to "actions@github.com" commit_author: Flake Bot # defaults to author of the commit that triggered the run - skip_dirty_check: false + skip_dirty_check: false skip_fetch: true diff --git a/.github/workflows/git-sync-mirrors.yml b/.github/workflows/git-sync-mirrors.yml new file mode 100644 index 00000000..b78b6ee1 --- /dev/null +++ b/.github/workflows/git-sync-mirrors.yml @@ -0,0 +1,29 @@ +name: "git" +on: [push] +jobs: + sync-codeberg: + runs-on: ubuntu-latest + steps: + - name: check out repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: "sync codeberg mirror" + uses: yesolutions/mirror-action@v0.7.0 + with: + REMOTE: 'https://codeberg.org/alyraffauf/nixcfg.git' + GIT_USERNAME: alyraffauf + GIT_PASSWORD: ${{ secrets.CODEBERG_PASSWORD }} + sync-gitlab: + runs-on: ubuntu-latest + steps: + - name: check out repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: "sync gitlab mirror" + uses: yesolutions/mirror-action@v0.7.0 + with: + REMOTE: 'https://gitlab.com/alyraffauf/nixcfg.git' + GIT_USERNAME: alyraffauf + GIT_PASSWORD: ${{ secrets.GITLAB_PASSWORD }}