-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (62 loc) · 2.17 KB
/
build-pr.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
57
58
59
60
61
62
63
64
65
66
name: Build-PR
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
avslutt-andre-workflows-samme-branch:
name: Avslutt andre workflows på samme branch
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # ratchet:styfle/[email protected]
with:
access_token: ${{ github.token }}
ktlint:
name: Ktlint
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # ratchet:actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: 'maven'
- name: Kjør ktlint
env:
GITHUB_USERNAME: x-access-token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mvn antrun:run@ktlint
tester:
name: Tester
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
- uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # ratchet:actions/setup-java@v4
with:
java-version: "21"
distribution: 'temurin'
cache: 'maven'
- name: Kjør enhetstester
env:
GITHUB_USERNAME: x-access-token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mvn verify -B --no-transfer-progress --settings .m2/maven-settings.xml --file pom.xml
- name: Last opp Jacoco enhetstester rapport
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # ratchet:actions/upload-artifact@v4
with:
name: jacocoUT
path: target/jacoco/UT/jacoco.xml
retention-days: 1
overwrite: true