From e270b8abe5379be569e75f16efca7e36c0170a86 Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Wed, 12 Feb 2025 11:11:35 +0100 Subject: [PATCH 1/9] ci: add CI workflow configuration file --- .gitea/workflows/ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..c32dab9 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,21 @@ +name: CI + +on: + pull_request: + +jobs: + test-build: + name: test-build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v2 + - uses: actions/cache@v4 + with: + path: | + ~/.npm + key: ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} + restore-keys: | + ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}- + - run: bun install + - run: bun run build From d1aa0222a1167929a8177a144d8e6c24d252f12a Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Wed, 12 Feb 2025 11:13:45 +0100 Subject: [PATCH 2/9] ci: change runner to remote in CI configuration --- .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 c32dab9..158e66a 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -6,7 +6,7 @@ on: jobs: test-build: name: test-build - runs-on: ubuntu-latest + runs-on: remote steps: - uses: actions/checkout@v4 - uses: oven-sh/setup-bun@v2 From cb80b041a63f5e46c9228bec4978ea69ed062df1 Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Wed, 12 Feb 2025 11:16:48 +0100 Subject: [PATCH 3/9] ci: update CI workflow to use new container image --- .gitea/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 158e66a..6234d3a 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -7,6 +7,8 @@ jobs: test-build: name: test-build runs-on: remote + container: + image: catthehacker/ubuntu:act-latest steps: - uses: actions/checkout@v4 - uses: oven-sh/setup-bun@v2 From f51d32ba5f315d191f55e7f74c06786b2c7505f0 Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Wed, 12 Feb 2025 11:20:51 +0100 Subject: [PATCH 4/9] ci: add cd command to frontend in CI workflow --- .gitea/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 6234d3a..0f1e330 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -19,5 +19,6 @@ jobs: key: ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} restore-keys: | ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}- + - run: cd frontend - run: bun install - run: bun run build From 3e1e42fa31874572da031d96c7b07cdab3dca4f5 Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Wed, 12 Feb 2025 11:21:56 +0100 Subject: [PATCH 5/9] ci: update CI script for better readability --- .gitea/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 0f1e330..4b95517 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -19,6 +19,7 @@ jobs: key: ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} restore-keys: | ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}- - - run: cd frontend - - run: bun install + - run: | + cd frontend + bun install - run: bun run build From ac3c84106dbb27660a9d37da9c6e504341896fb5 Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Wed, 12 Feb 2025 11:23:38 +0100 Subject: [PATCH 6/9] ci: improve CI workflow with step names for clarity --- .gitea/workflows/ci.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 4b95517..269ef51 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -10,16 +10,23 @@ jobs: container: image: catthehacker/ubuntu:act-latest steps: - - uses: actions/checkout@v4 - - uses: oven-sh/setup-bun@v2 - - uses: actions/cache@v4 + - name: Checkout Code + uses: actions/checkout@v4 + - name: Install bun + uses: oven-sh/setup-bun@v2 + - name: Cache + uses: actions/cache@v4 with: path: | ~/.npm key: ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} restore-keys: | ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}- - - run: | + - name: Install dependencies + run: | cd frontend bun install - - run: bun run build + - name: Test build + run: | + cd frontend + bun run build From 343704959bc5e61b6d5454f1c47d04ec8e408b15 Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Wed, 12 Feb 2025 11:31:32 +0100 Subject: [PATCH 7/9] ci: update runner from remote to vps-4 in workflows --- .gitea/workflows/ci.yml | 2 +- .gitea/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 269ef51..760e3f4 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -6,7 +6,7 @@ on: jobs: test-build: name: test-build - runs-on: remote + runs-on: vps-4 container: image: catthehacker/ubuntu:act-latest steps: diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 51e555c..fa827f3 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -13,7 +13,7 @@ permissions: jobs: release: name: Release - runs-on: remote + runs-on: vps-4 permissions: contents: write issues: write From dc1482c3206823a834a355f915c53446f8a0c6c3 Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Wed, 12 Feb 2025 11:33:32 +0100 Subject: [PATCH 8/9] ci: add prettier job to CI workflow --- .gitea/workflows/ci.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 760e3f4..e537b78 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -4,6 +4,33 @@ on: pull_request: jobs: + prettier: + name: prettier + runs-on: vps-4 + container: + image: catthehacker/ubuntu:act-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + - name: Install bun + uses: oven-sh/setup-bun@v2 + - name: Cache + uses: actions/cache@v4 + with: + path: | + ~/.npm + key: ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} + restore-keys: | + ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}- + - name: Install dependencies + run: | + cd frontend + bun install + - name: Run prettier + run: | + cd frontend + bun run format:check + test-build: name: test-build runs-on: vps-4 From 2d955eed1afd621efe91fe229e8abc3d6abbb4dd Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Wed, 12 Feb 2025 11:36:45 +0100 Subject: [PATCH 9/9] ci: remove caching from CI workflow configuration --- .gitea/workflows/ci.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index e537b78..eaead1c 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -14,14 +14,6 @@ jobs: uses: actions/checkout@v4 - name: Install bun uses: oven-sh/setup-bun@v2 - - name: Cache - uses: actions/cache@v4 - with: - path: | - ~/.npm - key: ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} - restore-keys: | - ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}- - name: Install dependencies run: | cd frontend @@ -41,14 +33,6 @@ jobs: uses: actions/checkout@v4 - name: Install bun uses: oven-sh/setup-bun@v2 - - name: Cache - uses: actions/cache@v4 - with: - path: | - ~/.npm - key: ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} - restore-keys: | - ${{ runner.os }}-bun-${{ hashFiles('**/package-lock.json') }}- - name: Install dependencies run: | cd frontend