-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make GitHub actions robust for branch names master and main.
- Loading branch information
Showing
7 changed files
with
195 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: 'Build and autograde' | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
Build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
check-latest: true | ||
cache: 'maven' | ||
- name: Compile, Test and Analysis | ||
run: mvn -V --color always -ntp clean verify -Dmaven.test.failure.ignore=true | tee maven.log | ||
- name: Mutation Coverage | ||
run: mvn -V --color always -ntp org.pitest:pitest-maven:mutationCoverage | ||
- name: Autograding | ||
uses: uhafner/autograding-github-action@v1.7.0 | ||
with: | ||
TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
HEAD_SHA: ${{github.event.pull_request.head.sha}} | ||
CONFIG: > | ||
{ | ||
"analysis": { | ||
"tools": [ | ||
{ | ||
"id": "error-prone", | ||
"pattern": "**/*.log" | ||
}, | ||
{ | ||
"id": "java", | ||
"pattern": "**/*.log" | ||
}, | ||
{ | ||
"id": "javadoc-warnings", | ||
"pattern": "**/*.log" | ||
}, | ||
{ | ||
"id": "checkstyle", | ||
"pattern": "**/checkstyle-result.xml" | ||
}, | ||
{ | ||
"id": "pmd", | ||
"pattern": "**/pmd.xml" | ||
}, | ||
{ | ||
"id": "spotbugs", | ||
"pattern": "**/spotbugsXml.xml" | ||
} | ||
], | ||
"maxScore": 100, | ||
"errorImpact": -5, | ||
"highImpact": -2, | ||
"normalImpact": -1, | ||
"lowImpact": -1 | ||
}, | ||
"tests": { | ||
"maxScore": 100, | ||
"passedImpact": 0, | ||
"failureImpact": -5, | ||
"skippedImpact": -1 | ||
}, | ||
"coverage": { | ||
"maxScore": 100, | ||
"coveredPercentageImpact": 0, | ||
"missedPercentageImpact": -1 | ||
}, | ||
"pit": { | ||
"maxScore": 100, | ||
"detectedImpact": 0, | ||
"undetectedImpact": -1, | ||
"detectedPercentageImpact": 0, | ||
"undetectedPercentageImpact": 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Check Markdown links | ||
|
||
on: push | ||
|
||
jobs: | ||
markdown-link-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: gaurav-nelson/github-action-markdown-link-check@v1 | ||
with: | ||
check-modified-files-only: 'no' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
branches: | ||
- master | ||
- main | ||
schedule: | ||
- cron: "32 3 * * 0" | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ java ] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 11 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
queries: +security-and-quality | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
with: | ||
category: "/language:${{ matrix.language }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: 'Generate coverage report' | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
coverage: | ||
|
||
runs-on: ubuntu-latest | ||
name: Coverage on Ubuntu | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
check-latest: true | ||
- name: Generate coverage with JaCoCo | ||
run: mvn -V --color always -ntp clean verify --file pom.xml '-Dgpg.skip' | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: 'target/site/jacoco/jacoco.xml' | ||
token: ${{secrets.CODECOV_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Enforce PR labels | ||
|
||
on: | ||
pull_request: | ||
types: [unlabeled] | ||
jobs: | ||
enforce-label: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: yogevbd/enforce-label-action@2.1.0 | ||
with: | ||
REQUIRED_LABELS_ANY: "bug,feature,enhancement,deprecated,removed,tests,documentation,internal,dependencies" | ||
REQUIRED_LABELS_ANY_DESCRIPTION: "Maintainer needs to assign at least one label before merge" | ||
BANNED_LABELS: "banned" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters