157 lines
4 KiB
YAML
157 lines
4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
jobs:
|
|
checkstyle:
|
|
name: "Checkstyle Main"
|
|
container:
|
|
image: "cimg/openjdk:23.0-node"
|
|
steps:
|
|
- name: "Checkout"
|
|
uses: actions/checkout@v3
|
|
- name: Set Java Home
|
|
run: echo "JAVA_HOME=$HOME/.java" >> $GITHUB_ENV
|
|
- name: Setup Java 23
|
|
uses: https://github.com/actions/setup-java@v3
|
|
with:
|
|
distribution: "temurin"
|
|
java-version: "23"
|
|
- name: "Cache Gradle dependencies"
|
|
uses: https://github.com/actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: gradle-${{ runner.os }}-common
|
|
restore-keys: |
|
|
gradle-${{ runner.os }}-
|
|
- name: "Prepare Gradle"
|
|
working-directory: ./backend
|
|
run: gradle clean
|
|
- name: "Check"
|
|
working-directory: ./backend
|
|
run: gradle checkstyleMain
|
|
- name: "Stop Gradle"
|
|
working-directory: ./backend
|
|
run: gradle --stop
|
|
|
|
test:
|
|
name: "Test"
|
|
container:
|
|
image: "cimg/openjdk:22.0-node"
|
|
steps:
|
|
- name: "Checkout"
|
|
uses: actions/checkout@v3
|
|
- name: Set Java Home
|
|
run: echo "JAVA_HOME=$HOME/.java" >> $GITHUB_ENV
|
|
- name: Setup Java 23
|
|
uses: https://github.com/actions/setup-java@v3
|
|
with:
|
|
distribution: "temurin"
|
|
java-version: "23"
|
|
- name: "Cache Gradle dependencies"
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: gradle-${{ runner.os }}-common
|
|
restore-keys: |
|
|
gradle-${{ runner.os }}-
|
|
- name: "Prepare Gradle"
|
|
working-directory: ./backend
|
|
run: gradle clean
|
|
- name: "Test"
|
|
working-directory: ./backend
|
|
run: gradle test
|
|
- name: "Stop Gradle"
|
|
working-directory: ./backend
|
|
run: gradle --stop
|
|
|
|
eslint:
|
|
name: eslint
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
- name: Install bun
|
|
uses: oven-sh/setup-bun@v2
|
|
- uses: actions/cache@v3
|
|
working-directory: ./frontend
|
|
with:
|
|
path: |
|
|
frontend/node_modules/
|
|
key: ${{ runner.os }}-bun-
|
|
restore-keys: |
|
|
${{ runner.os }}-bun-
|
|
- name: Install dependencies
|
|
run: |
|
|
cd frontend
|
|
bun install
|
|
- name: Run Eslint
|
|
run: |
|
|
cd frontend
|
|
bun run lint
|
|
|
|
prettier:
|
|
name: prettier
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
- name: Install bun
|
|
uses: oven-sh/setup-bun@v2
|
|
- uses: actions/cache@v3
|
|
working-directory: ./frontend
|
|
with:
|
|
path: |
|
|
frontend/node_modules/
|
|
key: ${{ runner.os }}-bun-
|
|
restore-keys: |
|
|
${{ runner.os }}-bun-
|
|
- name: Install dependencies
|
|
run: |
|
|
cd frontend
|
|
bun install
|
|
- name: Run prettier
|
|
run: |
|
|
cd frontend
|
|
bun run format:check
|
|
|
|
test-build:
|
|
name: test-build
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
- name: Install bun
|
|
uses: oven-sh/setup-bun@v2
|
|
- uses: actions/cache@v3
|
|
working-directory: ./frontend
|
|
with:
|
|
path: |
|
|
frontend/node_modules/
|
|
key: ${{ runner.os }}-bun-
|
|
restore-keys: |
|
|
${{ runner.os }}-bun-
|
|
- uses: actions/cache@v3
|
|
working-directory: ./frontend
|
|
with:
|
|
path: |
|
|
frontend/dist/
|
|
key: ${{ runner.os }}-dist-
|
|
restore-keys: |
|
|
${{ runner.os }}-dist-
|
|
- name: Install dependencies
|
|
run: |
|
|
cd frontend
|
|
bun install
|
|
- name: Test build
|
|
run: |
|
|
cd frontend
|
|
bun run build
|