Skip to content

adapt e2e tests to progpedia dataset #1

adapt e2e tests to progpedia dataset

adapt e2e tests to progpedia dataset #1

Workflow file for this run

# Builds JPlag and then runs Datasets and Report Viewer e2e tests on multiple OS
name: Complete e2e Test
on:
workflow_dispatch:
# temprary
push:
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: Run Tests
run: mvn verify -B -U
- name: Build Assembly
run: mvn -Pwith-report-viewer -DskipTests clean package assembly:single
- name: Raname 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"
run_jplag:
needs: build_jar
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
dataset: [
{zip: "progpedia.zip", name: "progpedia", folder: "ACCEPTED", base: "base", language: "java", 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
run: |
if [${{matrix.os}} == "windows-latest"]; then
Expand-Archive -LiteralPath .github/workflows/files/${{ matrix.dataset.zip }} -DestinationPath ./
elif [${{matrix.os}} == "macos-latest"]; then
unzip .github/workflows/files/${{ matrix.dataset.zip }} -d ./
else
unzip ./ .github/workflows/files/${{ matrix.dataset.zip }}
fi
- name: Run JPlag
run: |
if [${{matrix.dataset.base}} == "undefined"]; then
java -jar jplag.jar ${{ matrix.dataset.folder }} -l ${{ matrix.dataset.language }} -r ${{ matrix.dataset.name }}-report ${{ matrix.dataset.cliArgs }}
else
java -jar jplag.jar ${{ matrix.dataset.folder }} -l ${{ matrix.dataset.language }} -r ${{ matrix.dataset.name }}-report -bc ${{ matrix.os.base }} ${{ matrix.dataset.cliArgs }}
fi
- name: Upload Result
uses: actions/upload-artifact@v4
with:
name: "${{ matrix.dataset.name }}-${{ matrix.os }}"
path: "${{ matrix.dataset.name }}-report.zip"
e2e_test:
needs: run_jplag
runs-on: ${{ matrix.os }}
strategy:
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:
name: "progpedia-${{ matrix.os }}"
path: "report-viewer/tests/e2e/assets/progpedia.zip"
- name: Rename Files
working-directory: report-viewer/tests/e2e/assets
run: |
if [${{matrix.os}} == "windows-latest"]; then
ren progpedia-${{matrix.os}}.zip progpedia.zip
else
mv progpedia-${{matrix.os}}.zip progpedia.zip
fi
- 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