Repository navigation
73 lines (57 loc) · 1.83 KB
/
Copy pathjava-react-ci.yml
File metadata and controls
73 lines (57 loc) · 1.83 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
name: Java, Maven, and React Native CI
# continuous integration
on:
workflow_dispatch:
env:
JAVA_VERSION: '17'
NODE_VERSION: '14'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{env.JAVA_VERSION}}
distribution: 'temurin'
- name: Cache Maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build and test Java project
run: mvn -B package --file pom.xml
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: ${{env.NODE_VERSION}}
#- name: Cache dependencies
# uses: actions/cache@v2
#with:
# path: ~/.npm
#key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
#restore-keys: |
# ${{ runner.os }}-node-
#- name: Install dependencies
# run: npm install
# - name: Build and test
# run: npm run test
- name: Cache Yarn packages
uses: actions/cache@v2
with:
path: ~/.yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Install npm dependencies
run: yarn install
- name: Build and test React Native project
run: yarn test
# - name: Build project with Maven
# run: mvn -B package --file pom.xml
# - name: Publish package
# run: mvn --batch-mode deploy
# env:
# GITHUB_TOKEN: ${{ secrets.Workflow2_PAT_TOKEN_GITHUB }}