Skip to content

Commit

Permalink
ci: upgrade github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeDombo committed Apr 4, 2024
1 parent 23a4540 commit 50be185
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 32 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v4
- uses: wagoid/commitlint-github-action@v6
if: matrix.os == 'ubuntu-latest'
- name: Set up JDK 1.8
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 1.8
distribution: corretto
java-version: 8
cache: maven
- name: Build with Maven (Windows)
env:
TEMP: "C:\\Temp"
Expand All @@ -30,7 +32,7 @@ jobs:
run: mvn -U -ntp clean verify
if: matrix.os != 'windows-latest'
- name: Upload Failed Test Report
uses: actions/upload-artifact@v1.0.0
uses: actions/upload-artifact@v4
if: failure()
with:
name: Failed Test Report ${{ matrix.os }}
Expand All @@ -41,13 +43,13 @@ jobs:
python3 ./.github/scripts/cover2cover.py server/target/jacoco-report/jacoco.xml src/main/java > server/target/jacoco-report/cobertura.xml
if: matrix.os == 'ubuntu-latest'
- name: Upload Client Coverage
uses: actions/upload-artifact@v1.0.0
uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest'
with:
name: Client Coverage Report
path: client/target/jacoco-report
- name: Upload Server Coverage
uses: actions/upload-artifact@v1.0.0
uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest'
with:
name: Server Coverage Report
Expand All @@ -63,7 +65,7 @@ jobs:
cp server/target/jacoco-report/cobertura.xml ./pr/server/jacoco-report/cobertura.xml
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest'
- name: Upload files
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: pr
path: pr/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

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

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
35 changes: 12 additions & 23 deletions .github/workflows/externalPR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,30 @@ on:
workflows: ["CI with Maven"]
types:
- completed
pull_request:
branches: '*'

jobs:
comment:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
name: Comment
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Download artifact'
uses: actions/github-script@v3.1.0
uses: actions/download-artifact@v4
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "pr"
})[0];
var download = await github.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data));
run-id: ${{github.event.workflow_run.id }}
name: pr
- run: unzip pr.zip
- name: outputs
run: |-
echo '::set-output name=PR::$(cat NR)'
echo '::set-output name=SHA::$(cat SHA)'
echo "PR=$(cat NR)" >> $GITHUB_ENV
echo "SHA=$(cat SHA)" >> $GITHUB_ENV
- name: cobertura-report-client-test
uses: 5monkeys/cobertura-action@master
uses: 5monkeys/cobertura-action@v14
continue-on-error: true
with:
# The GITHUB_TOKEN for this repo
Expand All @@ -61,8 +48,9 @@ jobs:
# Use a unique name for the report and comment
report_name: Client Coverage Report
pull_request_number: ${{ steps.outputs.outputs.PR }}
only_changed_files: true
- name: cobertura-report-server-test
uses: 5monkeys/cobertura-action@master
uses: 5monkeys/cobertura-action@v14
continue-on-error: true
with:
# The GITHUB_TOKEN for this repo
Expand All @@ -82,3 +70,4 @@ jobs:
# Use a unique name for the report and comment
report_name: Server Coverage Report
pull_request_number: ${{ steps.outputs.outputs.PR }}
only_changed_files: true

0 comments on commit 50be185

Please sign in to comment.