chore(ci): refactor CI workflow for improved readability and maintainability
This commit is contained in:
@@ -1,63 +1,66 @@
|
|||||||
name: CI
|
name: CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- '*'
|
- "*"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
UV_LINK_MODE: copy
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: https://git.quad4.io/actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
uses: https://git.quad4.io/actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: https://git.quad4.io/actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
|
uses: https://git.quad4.io/actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 22
|
||||||
cache: pnpm
|
cache: pnpm
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: https://git.quad4.io/actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
|
uses: https://git.quad4.io/actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
|
||||||
with:
|
with:
|
||||||
python-version: "3.13"
|
python-version: "3.13"
|
||||||
- name: Setup Task
|
- name: Setup Task
|
||||||
uses: https://git.quad4.io/actions/setup-task@0ab1b2a65bc55236a3bc64cde78f80e20e8885c2 # v1
|
uses: https://git.quad4.io/actions/setup-task@0ab1b2a65bc55236a3bc64cde78f80e20e8885c2 # v1
|
||||||
with:
|
with:
|
||||||
version: '3.46.3'
|
version: "3.46.3"
|
||||||
- name: Setup uv
|
- name: Setup uv
|
||||||
run: |
|
run: |
|
||||||
task setup-uv
|
task setup-uv
|
||||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||||
- name: Setup Python environment
|
- name: Setup Python environment
|
||||||
run: task setup-python-env
|
run: task setup-python-env
|
||||||
- name: Install Node dependencies
|
- name: Install Node dependencies
|
||||||
run: task node_modules
|
run: task node_modules
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: task lint
|
run: task lint
|
||||||
|
|
||||||
build-frontend:
|
build-frontend:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: https://git.quad4.io/actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
uses: https://git.quad4.io/actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: https://git.quad4.io/actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
|
uses: https://git.quad4.io/actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 22
|
||||||
cache: pnpm
|
cache: pnpm
|
||||||
- name: Setup Task
|
- name: Setup Task
|
||||||
uses: https://git.quad4.io/actions/setup-task@0ab1b2a65bc55236a3bc64cde78f80e20e8885c2 # v1
|
uses: https://git.quad4.io/actions/setup-task@0ab1b2a65bc55236a3bc64cde78f80e20e8885c2 # v1
|
||||||
with:
|
with:
|
||||||
version: '3.46.3'
|
version: "3.46.3"
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: task node_modules
|
run: task node_modules
|
||||||
- name: Determine version
|
- name: Determine version
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
SHORT_SHA=$(git rev-parse --short HEAD)
|
SHORT_SHA=$(git rev-parse --short HEAD)
|
||||||
echo "version=${SHORT_SHA}" >> $GITHUB_OUTPUT
|
echo "version=${SHORT_SHA}" >> $GITHUB_OUTPUT
|
||||||
- name: Build frontend
|
- name: Build frontend
|
||||||
run: task build-frontend
|
run: task build-frontend
|
||||||
env:
|
env:
|
||||||
VITE_APP_VERSION: ${{ steps.version.outputs.version }}
|
VITE_APP_VERSION: ${{ steps.version.outputs.version }}
|
||||||
|
|||||||
Reference in New Issue
Block a user