Skip to content

Commit 637eb64

Browse files
committed
refactor: workflows
1 parent e7ce1c4 commit 637eb64

5 files changed

Lines changed: 202 additions & 184 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 155 deletions
This file was deleted.

.github/workflows/codeql.yml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,33 +24,33 @@ jobs:
2424
fail-fast: false
2525
matrix:
2626
include:
27-
- language: actions
28-
build-mode: none
29-
- language: go
30-
build-mode: autobuild
31-
- language: javascript-typescript
32-
build-mode: none
27+
- language: actions
28+
build-mode: none
29+
- language: go
30+
build-mode: autobuild
31+
- language: javascript-typescript
32+
build-mode: none
3333
steps:
34-
- name: Checkout repository
35-
uses: actions/checkout@v4
36-
37-
- name: Initialize CodeQL
38-
uses: github/codeql-action/init@v3
39-
with:
40-
languages: ${{ matrix.language }}
41-
build-mode: ${{ matrix.build-mode }}
42-
43-
- if: matrix.build-mode == 'manual'
44-
shell: bash
45-
run: |
46-
echo 'If you are using a "manual" build mode for one or more of the' \
47-
'languages you are analyzing, replace this with the commands to build' \
48-
'your code, for example:'
49-
echo ' make bootstrap'
50-
echo ' make release'
51-
exit 1
52-
53-
- name: Perform CodeQL Analysis
54-
uses: github/codeql-action/analyze@v3
55-
with:
56-
category: "/language:${{matrix.language}}"
34+
- name: Checkout repository
35+
uses: actions/checkout@v4
36+
37+
- name: Initialize CodeQL
38+
uses: github/codeql-action/init@v3
39+
with:
40+
languages: ${{ matrix.language }}
41+
build-mode: ${{ matrix.build-mode }}
42+
43+
- if: matrix.build-mode == 'manual'
44+
shell: bash
45+
run: |
46+
echo 'If you are using a "manual" build mode for one or more of the' \
47+
'languages you are analyzing, replace this with the commands to build' \
48+
'your code, for example:'
49+
echo ' make bootstrap'
50+
echo ' make release'
51+
exit 1
52+
53+
- name: Perform CodeQL Analysis
54+
uses: github/codeql-action/analyze@v3
55+
with:
56+
category: "/language:${{matrix.language}}"

.github/workflows/go.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Go CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- '**.go'
8+
- 'go.mod'
9+
- 'go.sum'
10+
- '.github/workflows/go.yml'
11+
pull_request:
12+
paths:
13+
- '**.go'
14+
- 'go.mod'
15+
- 'go.sum'
16+
- '.github/workflows/go.yml'
17+
workflow_dispatch:
18+
19+
permissions:
20+
contents: write
21+
pull-requests: write
22+
23+
jobs:
24+
build-test-vet:
25+
name: Build, Test & Vet
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
- name: Setup Go
32+
uses: actions/setup-go@v5
33+
with:
34+
go-version-file: 'go.mod'
35+
cache: true
36+
37+
- name: Dependencies
38+
run: go mod tidy
39+
40+
- name: Test
41+
run: go test -vet=off $(go list ./...)
42+
43+
- name: Vet
44+
run: go vet $(go list ./...)
45+
46+
- name: Build
47+
run: go build -v ./...
48+
49+
lint:
50+
name: Go Lint
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Checkout repository
54+
uses: actions/checkout@v4
55+
56+
- name: Setup Go
57+
uses: actions/setup-go@v5
58+
with:
59+
go-version-file: 'go.mod'
60+
61+
- name: Run golangci-lint
62+
uses: golangci/golangci-lint-action@v8
63+
with:
64+
version: latest
65+
args: --fix
66+
67+
- name: Create Pull Request with lint fixes
68+
if: github.ref == 'refs/heads/main'
69+
uses: peter-evans/create-pull-request@v7
70+
with:
71+
token: ${{ secrets.GITHUB_TOKEN }}
72+
commit-message: "chore(backend): apply linting fixes"
73+
title: "chore(backend): apply linting fixes"
74+
body: "Automated linting fixes."
75+
branch: "chore/go-lint-fixes"
76+
base: main
77+
signoff: true

.github/workflows/react.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: React CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'Frontend/**'
8+
- '.github/workflows/react.yml'
9+
pull_request:
10+
paths:
11+
- 'Frontend/**'
12+
- '.github/workflows/react.yml'
13+
workflow_dispatch:
14+
15+
permissions:
16+
contents: write
17+
pull-requests: write
18+
19+
defaults:
20+
run:
21+
working-directory: Frontend
22+
23+
jobs:
24+
lint:
25+
name: Frontend Lint
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
- name: Install Bun
32+
uses: oven-sh/setup-bun@v2
33+
with:
34+
bun-version: latest
35+
36+
- name: Install dependencies
37+
run: bun install
38+
39+
- name: Check linting (ESLint)
40+
run: bun run lint:fix
41+
42+
- name: Create Pull Request with lint fixes
43+
if: github.ref == 'refs/heads/main'
44+
uses: peter-evans/create-pull-request@v7
45+
with:
46+
token: ${{ secrets.GITHUB_TOKEN }}
47+
commit-message: "chore(frontend): apply linting fixes"
48+
title: "chore(frontend): apply linting fixes"
49+
body: "Automated linting fixes."
50+
branch: "chore/frontend-lint-fixes"
51+
base: main
52+
signoff: true

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
release:
14+
name: Build and Release
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version-file: 'go.mod'
24+
25+
- name: Install Bun
26+
uses: oven-sh/setup-bun@v2
27+
with:
28+
bun-version: latest
29+
30+
- name: Install frontend dependencies
31+
run: bun install
32+
working-directory: Frontend
33+
34+
- name: Build Frontend
35+
run: bun run build
36+
working-directory: Frontend
37+
38+
- name: Run GoReleaser
39+
uses: goreleaser/goreleaser-action@v6
40+
with:
41+
version: latest
42+
args: release --clean
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)