From ff5f2883ea1402af3ee5c48dcbe07cbc207e4a4b Mon Sep 17 00:00:00 2001 From: Deepak Mallubhotla Date: Sat, 22 Mar 2025 18:01:03 -0500 Subject: [PATCH] ci: add nix-check.yaml --- .gitea/workflows/nix-check.yaml | 47 +++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .gitea/workflows/nix-check.yaml diff --git a/.gitea/workflows/nix-check.yaml b/.gitea/workflows/nix-check.yaml new file mode 100644 index 0000000..962a92a --- /dev/null +++ b/.gitea/workflows/nix-check.yaml @@ -0,0 +1,47 @@ +name: Test templates, puts into cache +run-name: ${{ gitea.actor }} checking our nix flake +on: [push] +jobs: + nix: + strategy: + fail-fast: true + matrix: + # os: [ubuntu-latest, nix-runner] + os: [nix-runner] + runs-on: ${{ matrix.os }} + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" + - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + - name: Install SSH keys + uses: shimataro/ssh-key-action@d4fffb50872869abe2d9a9098a6d9c5aa7d16be4 + with: + key: ${{ secrets.SSH_GITEA_SSH_KEY }} + name: gitea_action + known_hosts: ${{ secrets.SSH_GITEA_KNOWN_HOSTS }} + - name: Agent SSH keys + uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: ${{ secrets.SSH_GITEA_SSH_KEY }} + # name: gitea_action + # known_hosts: ${{ secrets.SSH_GITEA_KNOWN_HOSTS }} + #- name: Fix SSH key + # run: sed -i 's/\r$//g' /root/.ssh/gitea_action + - name: List files in the repository + run: | + ls ${{ gitea.workspace }} + # installing nix not necessary for nix-runner but doesn't take much time + - name: Install Nix + uses: cachix/install-nix-action@v31 + - run: nix build --version + - name: Setup Attic Cache + uses: ryanccn/attic-action@3354ae812cb672e1381be4c7914204c44db53866 + with: + endpoint: ${{ secrets.ATTIC_ENDPOINT }} + cache: ${{ secrets.ATTIC_CACHE }} + token: ${{ secrets.ATTIC_TOKEN }} + - name: Build Nix Package + run: nix flake check + - run: echo "🎉 All done, have a great day!"