-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (51 loc) · 1.35 KB
/
backend-ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Setup an action to run the backend CI for PRs
# name of the action
name: Backend CI
# when should it run
on:
pull_request:
branches:
- main
# what should it do
jobs:
# name of the job
build:
# what should it run on
runs-on: ubuntu-latest
# default values for all the steps
defaults:
run:
working-directory: backend
permissions:
contents: read
packages: read
# To report GitHub Actions status checks
statuses: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Run Maven build
run: mvn install -DskipTests -q
- name: Run tests
run: mvn test -q
- name: Run check style
uses: nikitasavinov/checkstyle-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: 'github-pr-check'
tool_name: 'testtool'
fail_on_error: true
level: warning,error
workdir: backend