-
Notifications
You must be signed in to change notification settings - Fork 2
73 lines (70 loc) · 2.24 KB
/
maven.yml
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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
validate-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Validate formatting
run: mvn -ntp -B formatter:validate
unit-test:
runs-on: ubuntu-latest
steps:
- name: Checkout project code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Set TB License
run: |
TB_LICENSE=${{secrets.TB_LICENSE}}
mkdir -p ~/.vaadin/
echo '{"username":"'`echo $TB_LICENSE | cut -d / -f1`'","proKey":"'`echo $TB_LICENSE | cut -d / -f2`'"}' > ~/.vaadin/proKey
- name: Run Java tests
run: mvn -ntp -B verify
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
registry-url: 'https://registry.npmjs.org'
cache: npm
cache-dependency-path: sso-kit-client/package-lock.json
- name: Cache node_modules
uses: actions/cache@v3
id: cache-node_modules
with:
path: sso-kit-client/node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('sso-kit-client/package-lock.json') }}
- name: Install npm dependencies
if: ${{ steps.cache-node_modules.outputs.cache-hit != 'true' }}
shell: bash
run: npm ci
working-directory: sso-kit-client
- name: Build TypeScript
run: npm run build
working-directory: sso-kit-client
- name: Lint TypeScript
run: npm run check
working-directory: sso-kit-client
- name: Install Chrome
uses: browser-actions/setup-chrome@v1
- name: Run TypeScript tests
run: npm run test
working-directory: sso-kit-client
env:
CI: true