Skip to content

Commit

Permalink
Merge branch 'jplag:main' into cpg-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
robinmaisch authored Feb 29, 2024
2 parents 4447224 + 9786faa commit 1b900a8
Show file tree
Hide file tree
Showing 669 changed files with 62,114 additions and 40,179 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

*.emfatic text
*.treeview text
36 changes: 36 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Documentation

on:
push:
branches:
- main
tags: "v**"
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
workflow_dispatch:

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.SDQ_DEV_DEPLOY_TOKEN }}
- uses: actions/checkout@v4
with:
repository: ${{ github.repository }}.wiki
path: wiki
token: ${{ secrets.SDQ_DEV_DEPLOY_TOKEN }}

- name: Remove contents in Wiki
working-directory: wiki
run: ls -A1 | grep -v '.git' | xargs rm -r

- name: Copy Wiki from Docs folder
run: cp -r ./docs/. ./wiki

- name: Deploy 🚀
uses: stefanzweifel/git-auto-commit-action@v5
with:
repository: wiki
Binary file added .github/workflows/files/progpedia.zip
Binary file not shown.
36 changes: 25 additions & 11 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
name: Build

on:
push:
push:
paths:
- ".github/workflows/maven.yml"
- "**/pom.xml"
- "**.java"
- "**.g4"
pull_request:
types: [opened, synchronize, reopened]

paths:
- ".github/workflows/maven.yml"
- "**/pom.xml"
- "**.java"
- "**.g4"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand All @@ -26,24 +36,28 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 17
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 clean package assembly:single
run: mvn -Pwith-report-viewer clean package assembly:single

- name: Upload Assembly
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "JPlag"
path: "jplag.cli/target/jplag-*-jar-with-dependencies.jar"


22 changes: 13 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ jobs:
publish-maven-central:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'temurin'
- name: Set maven settings.xml
uses: whelk-io/maven-settings-xml-action@v21
uses: whelk-io/maven-settings-xml-action@v22
with:
servers: '[{ "id": "ossrh", "username": "jplag", "password": "${{ secrets.OSSRH_TOKEN }}" }]'
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.PGP_SECRET }}
passphrase: ${{ secrets.PGP_PW }}
Expand All @@ -29,13 +29,17 @@ jobs:
publish-release-artifact:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'temurin'
- uses: actions/setup-node@v4
with:
node-version: "18"

- name: Build JPlag
run: mvn -U -B clean package assembly:single
run: mvn -Pwith-report-viewer -U -B clean package assembly:single

- name: Attach CLI to Release on GitHub
uses: softprops/action-gh-release@v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
paths:
- ".github/workflows/report-viewer-build-test.yml"
- "report-viewer/**"

jobs:
pre_job:
Expand All @@ -23,11 +26,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: "16"
node-version: "18"

- name: Set version of Report Viewer
shell: bash
Expand Down
113 changes: 113 additions & 0 deletions .github/workflows/report-viewer-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Report Viewer Demo Deployment

on:
workflow_dispatch: # Use this to dispatch from the Actions Tab
push:
branches:
- main

jobs:
build-jar:
runs-on: ubuntu-latest

steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'

- name: Build Assembly
run: mvn clean package assembly:single

- name: Upload Assembly
uses: actions/upload-artifact@v4
with:
name: "JPlag"
path: "cli/target/jplag-*-jar-with-dependencies.jar"


run-example:
needs: build-jar
runs-on: ubuntu-latest

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 submissions
run: unzip ./.github/workflows/files/progpedia.zip

- name: Rename jar
run: mv *.jar ./jplag.jar

- name: Run JPlag
run: java -jar jplag.jar ACCEPTED -bc base -r example

- name: Upload Result
uses: actions/upload-artifact@v4
with:
name: "Result"
path: "example.zip"


build-and-deploy:
needs: run-example
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: "18"

- name: Set version of Report Viewer
shell: bash
run: |
VERSION=$(grep "<revision>" pom.xml | grep -oPm1 "(?<=<revision>)[^-|<]+")
MAJOR=$(echo $VERSION | cut -d '.' -f 1)
MINOR=$(echo $VERSION | cut -d '.' -f 2)
PATCH=$(echo $VERSION | cut -d '.' -f 3)
json=$(cat report-viewer/src/version.json)
json=$(echo "$json" | jq --arg MAJOR "$MAJOR" --arg MINOR "$MINOR" --arg PATCH "$PATCH" '.report_viewer_version |= { "major": $MAJOR | tonumber, "minor": $MINOR | tonumber, "patch": $PATCH | tonumber }')
echo "$json" > report-viewer/src/version.json
echo "Version of Report Viewer:"
cat report-viewer/src/version.json
- name: Download Results
uses: actions/download-artifact@v4
with:
name: Result
path: report-viewer/public

- name: Install and Build 🔧
working-directory: report-viewer
run: |
npm install
npm run build-demo
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: report-viewer/dist
repository-name: JPlag/Demo
token: ${{ secrets.SDQ_DEV_DEPLOY_TOKEN }}
clean: true
single-commit: true

26 changes: 8 additions & 18 deletions .github/workflows/report-viewer-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,29 @@ on:
push:
branches:
- develop
paths:
- ".github/workflows/report-viewer-dev.yml"
- "report-viewer/**"

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: "16"

- name: Set version of Report Viewer
shell: bash
run: |
VERSION=$(grep "<revision>" pom.xml | grep -oPm1 "(?<=<revision>)[^-|<]+")
MAJOR=$(echo $VERSION | cut -d '.' -f 1)
MINOR=$(echo $VERSION | cut -d '.' -f 2)
PATCH=$(echo $VERSION | cut -d '.' -f 3)
sed -i "/major/s/.*/ \"major\": $MAJOR,/" report-viewer/src/version.json
sed -i "/minor/s/.*/ \"minor\": $MINOR,/" report-viewer/src/version.json
sed -i "/patch/s/.*/ \"patch\": $PATCH/" report-viewer/src/version.json
echo "Version of Report Viewer:"
cat report-viewer/src/version.json
node-version: "18"

- name: Install and Build 🔧
working-directory: report-viewer
run: |
npm install
npm run build
npm run build-dev
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.4.0
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
branch: gh-pages
folder: report-viewer/dist
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/report-viewer-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Report Viewer e2e Test

on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
paths:
- ".github/workflows/report-viewer-e2e.yml"
- "report-viewer/**"

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'

test:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-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: 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
path: |
report-viewer/test-results
report-viewer/playwright-report
retention-days: 30
Loading

0 comments on commit 1b900a8

Please sign in to comment.