-
Notifications
You must be signed in to change notification settings - Fork 157
163 lines (135 loc) · 4.62 KB
/
integration.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# This workflow executes the various RepoSense tests
name: Continuous Integration
on:
push:
branches-ignore:
- gh-pages
pull_request:
branches-ignore:
- gh-pages
env:
NODE_VER: '18.x'
JAVA_DISTRIBUTION: 'zulu'
JAVA_VER: 11
jobs:
mainbuild:
name: ${{ matrix.os }} JDK 11
strategy:
fail-fast: false
matrix:
# Deprecation Notice: MacOS 12 will be deprecated by the end of 2024
os: [ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, windows-2019, windows-2022]
runs-on: ${{ matrix.os }}
env:
HOMEBREW_NO_AUTO_UPDATE: 1 # Prevent time-consuming brew update
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VER }}
- name: Verify Java version
run: echo "Actual JDK in use -- "; java -version
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VER }}
- name: Set up Gradle caching
uses: actions/cache@v3
with:
path: |
$HOME/.gradle/caches
$HOME/.gradle/wrapper
key: ${{ matrix.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ matrix.os }}-gradle-
- name: Set up Node caching
uses: actions/cache@v3
with:
path: $HOME/.npm
key: ${{ matrix.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ matrix.os }}-node-
- name: Grant execute permission for gradlew
if: ${{ runner.os != 'Windows' }}
run: chmod +x gradlew # Windows does not need this
- name: Run environmental checks
run: ./gradlew environmentalChecks
- name: Run linter
run: ./gradlew lintFrontend
- name: Build with Gradle
run: ./gradlew clean checkstyleAll test systemTest coverage
- name: Run code coverage
if: ${{ success() && ( matrix.os == 'ubuntu-20.04' || matrix.os == 'macos-11' || matrix.os == 'windows-2022' ) }}
uses: codecov/codecov-action@v3
with:
directory: ${{ github.workspace }}/build/reports/jacoco/coverage
files: coverage.xml
fail_ci_if_error: false
- name: Build preview website (pull request)
if: ${{ success() && github.event_name == 'pull_request' && matrix.os == 'ubuntu-20.04' }}
run: |
git fetch --all && git config --global user.email "-" && git config --global user.name "-" && ./gradlew run -Dargs="--since d1"
sudo apt-get -y install graphviz
npm install -g markbind-cli
(cd docs && markbind build)
- name: Save PR number and HEAD commit (pull request)
if: ${{ success() && github.event_name == 'pull_request' && matrix.os == 'ubuntu-20.04' }}
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NUMBER
echo ${{ github.event.pull_request.head.sha }} > ./pr/SHA
- name: Upload artifacts (pull request)
if: ${{ success() && github.event_name == 'pull_request' && matrix.os == 'ubuntu-20.04' }}
uses: actions/upload-artifact@v3
with:
name: reposense-deployment
path: |
./reposense-report
./docs/_site
./pr
cypress:
name: Cypress frontend tests
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VER }}
- name: Verify Java version
run: echo "Actual JDK in use -- "; java -version
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VER }}
- name: Set up Gradle caching
uses: actions/cache@v3
with:
path: |
$HOME/.gradle/caches
$HOME/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up Node caching
uses: actions/cache@v3
with:
path: $HOME/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Set up environment
run: sudo apt-get install -y libgtk2.0-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2
- name: Run frontend tests
run: ./gradlew frontendTest -Pci