From 8c2dd534b9790958927776bfe9a8f7298f986f81 Mon Sep 17 00:00:00 2001 From: servostar Date: Thu, 21 Nov 2024 16:00:11 +0100 Subject: [PATCH 1/4] cI: remove release action --- .gitea/workflows/release.yml | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 .gitea/workflows/release.yml diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml deleted file mode 100644 index f2f6809..0000000 --- a/.gitea/workflows/release.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: release - -on: - push: - tags: - - 'v*.*.*' - -jobs: - release: - runs-on: ubuntu-latest - steps: - - name: Check out repository code - uses: actions/checkout@v3 - - name: Install dependencies for Nix setup action - run: | - apt update -y - apt install sudo -y - - name: Setup Nix - uses: cachix/install-nix-action@v27 - with: - nix_path: nixpkgs=channel:nixos-unstable - - name: Run CI - run: nix-shell --run ./run-ci.sh - - name: Setup go - uses: https://github.com/actions/setup-go@v4 - with: - go-version: '>=1.20.1' - - name: Create release - id: create-release - uses: https://gitea.com/actions/release-action@main - with: - files: |- - example.pdf - api_key: '${{secrets.RELEASE_TOKEN}}' -- 2.40.1 From 1aad5516403baf411b07efa493d353f68b8ae4cf Mon Sep 17 00:00:00 2001 From: servostar Date: Thu, 21 Nov 2024 16:06:53 +0100 Subject: [PATCH 2/4] ci: run gitea action on PR or optionally push --- .gitea/workflows/ci.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index c2b5e1d..b6a13a7 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -1,10 +1,16 @@ -name: Gitea Action for checking typst compilation +name: Build'n check run-name: Performing Typst compilation -on: [push] - +on: + push: + pull_request: + branches: + - main jobs: run-ci-linux: runs-on: ubuntu-latest + if: > + contains(github.event.head_commit.message, 'Run-Check') || + github.event_name == 'pull_request' steps: - name: Check out repository code uses: actions/checkout@v3 @@ -16,5 +22,9 @@ jobs: uses: cachix/install-nix-action@v27 with: nix_path: nixpkgs=channel:nixos-unstable - - name: Run CI - run: nix-shell --run ./run-ci.sh + - name: Stylecheck + run: nix-shell --run "./run-fmt.sh --check src/lib.typ" + - id: build + name: Build + run: | + nix-shell --run ./run-ci.sh -- 2.40.1 From c06ddd544c4dff919e9d22ab1072036421909afc Mon Sep 17 00:00:00 2001 From: servostar Date: Thu, 21 Nov 2024 16:08:46 +0100 Subject: [PATCH 3/4] ci: rename push run condition Run-Checks --- .gitea/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index b6a13a7..56e46c9 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: run-ci-linux: runs-on: ubuntu-latest if: > - contains(github.event.head_commit.message, 'Run-Check') || + contains(github.event.head_commit.message, 'Run-Checks') || github.event_name == 'pull_request' steps: - name: Check out repository code -- 2.40.1 From e0b1e9db4941f04776ee291325da6f445cf43914 Mon Sep 17 00:00:00 2001 From: servostar Date: Thu, 21 Nov 2024 16:15:36 +0100 Subject: [PATCH 4/4] ci: run gitea action from PR mutally exclusive to push Run-Checks --- .gitea/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 56e46c9..bc4eec0 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -8,8 +8,11 @@ on: jobs: run-ci-linux: runs-on: ubuntu-latest + # run action mutally exclusive on PRs or + # push with commit containing "Run-Checks" if: > - contains(github.event.head_commit.message, 'Run-Checks') || + (contains(github.event.head_commit.message, 'Run-Checks') && + github.event_name == 'push') || github.event_name == 'pull_request' steps: - name: Check out repository code -- 2.40.1