-
Notifications
You must be signed in to change notification settings - Fork 2
84 lines (68 loc) · 2.4 KB
/
Copy pathbuild-v2.yml
File metadata and controls
84 lines (68 loc) · 2.4 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: CI for v2
on:
push:
branches: [ 'master-v2' ]
pull_request:
branches: [ 'master-v2', 'develop-v2' ]
types: [ 'opened', 'reopened', 'edited', 'synchronize' ]
workflow_dispatch:
permissions:
contents: read
jobs:
cancel_previous-v2:
permissions:
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
with:
workflow_id: ${{ github.event.workflow.id }}
build-v2:
needs: cancel_previous
name: Build & Code Quality Checks
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Setup Java
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: 'temurin'
java-version: '11'
- name: Setup Ruby
uses: ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0
- name: Set Node 16
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install node_modules
run: |
npm ci
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: cache gradle dependencies
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-core-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-core-
- name: Build
run: |
git fetch --no-tags --prune --depth=100 origin master-v2
npm run build
- name: Unit test
run: |
git fetch --no-tags --prune --depth=100 origin master-v2
npm run test