-
Notifications
You must be signed in to change notification settings - Fork 321
160 lines (135 loc) · 5 KB
/
complete-e2e.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
# Builds JPlag and then runs Datasets and Report Viewer e2e tests on multiple OS
name: Complete e2e Test
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
paths:
- ".github/workflows/complete-e2e.yml"
- "report-viewer/**"
- "**/pom.xml"
- "**.java"
- "**.g4"
jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
concurrent_skipping: 'same_content_newer'
skip_after_successful_duplicate: 'true'
build_jar:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
- uses: actions/setup-node@v4
with:
node-version: "18"
- name: Build Assembly
run: mvn -DskipTests clean package assembly:single
- name: Rename Jar
run: mv cli/target/jplag-*-jar-with-dependencies.jar cli/target/jplag.jar
- name: Upload Assembly
uses: actions/upload-artifact@v4
with:
name: "JPlag"
path: "cli/target/jplag.jar"
retention-days: 30
run_jplag:
needs: build_jar
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
dataset: [
{zip: "progpedia.zip", name: "progpedia", folder: "ACCEPTED", language: "java", cliArgs: "-bc base"},
{zip: "fileSingleRoot.zip", name: "fileSingleRoot", folder: "fileSingleRoot", language: "java", cliArgs: ""},
{zip: "folderSingleRoot.zip", name: "folderSingleRoot", folder: "folderSingleRoot", language: "java", cliArgs: ""},
{zip: "fileMultiRoot.zip", name: "fileMultiRoot", folder: "f0", language: "java", cliArgs: "--new f1"},
{zip: "folderMultiRoot.zip", name: "folderMultiRoot", folder: "f0", language: "java", cliArgs: "--new f1"},
{zip: "mixedMultiRoot.zip", name: "mixedBaseFile", folder: "f0", language: "java", cliArgs: "--new f1"},
{zip: "mixedMultiRoot.zip", name: "mixedBaseFolder", folder: "f1", language: "java", cliArgs: "--new f0"},
{zip: "cpp.zip", name: "cpp", folder: "./cpp", language: "cpp", cliArgs: ""},
{zip: "csharp.zip", name: "csharp", folder: "./csharp", language: "csharp", cliArgs: ""},
{zip: "python.zip", name: "python", folder: "./python", language: "python3", cliArgs: ""}
]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
- name: Get JAR
uses: actions/download-artifact@v4
with:
name: JPlag
- name: Copy and unzip dataset windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
Expand-Archive -LiteralPath .github/workflows/files/${{ matrix.dataset.zip }} -DestinationPath ./
- name: Copy and unzip dataset macos and ubuntu
if: ${{ matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'}}
run: |
unzip .github/workflows/files/${{ matrix.dataset.zip }}
- name: Run JPlag
run: |
java -jar jplag.jar ${{ matrix.dataset.folder }} -l ${{ matrix.dataset.language }} -r ${{ matrix.dataset.name }}-report ${{ matrix.dataset.cliArgs }}
- name: Upload result
uses: actions/upload-artifact@v4
with:
name: "${{ matrix.dataset.name }}-${{ matrix.os }}"
path: "${{ matrix.dataset.name }}-report.zip"
retention-days: 30
e2e_test:
needs: run_jplag
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18"
- name: Install and Build
working-directory: report-viewer
run: |
npm install
npm run build
- name: Install playwright
working-directory: report-viewer
run: npx playwright install --with-deps
- name: Download JPlag Reports
uses: actions/download-artifact@v4
with:
pattern: "*-${{ matrix.os }}"
path: "report-viewer/tests/e2e/assets"
merge-multiple: true
- name: Run tests
working-directory: report-viewer
run: |
npm run test:e2e
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: "test-results-${{ matrix.os }}"
path: |
report-viewer/test-results
report-viewer/playwright-report
retention-days: 30