1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-21 21:52:10 +02:00

Add GitHub actions to Build and Test CDT

This commit is contained in:
Jonah Graham 2022-10-09 13:16:28 -04:00
parent 7adcdbe7d9
commit 9a22ad7097
2 changed files with 84 additions and 0 deletions

48
.github/workflows/build-test.yml vendored Normal file
View file

@ -0,0 +1,48 @@
name: Build and Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build and Test
run: |
export DISPLAY=:99
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
mvn \
clean verify -B -V \
-Dmaven.test.failure.ignore=true \
-DexcludedGroups=flakyTest,slowTest \
-P baseline-compare-and-replace \
-Ddsf.gdb.tests.timeout.multiplier=50 \
-Dindexer.timeout=300
- name: Upload Logs
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: Code Cleanliness Detailed Logs
path: '*.log'
- name: Upload Test Results
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results
path: |
*/*/target/surefire-reports/*.xml
terminal/plugins/org.eclipse.tm.terminal.test/target/surefire-reports/*.xml

36
.github/workflows/report.yml vendored Normal file
View file

@ -0,0 +1,36 @@
name: Unit Test Results
on:
workflow_run:
workflows: ["Build and Test"]
types:
- completed
jobs:
unit-test-results:
name: Unit Test Results
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion != 'skipped'
steps:
- name: Download Test Report
uses: dawidd6/action-download-artifact@v2
with:
name: test-results
path: test-results
workflow: ${{ github.event.workflow.id }}
run_id: ${{ github.event.workflow_run.id }}
- name: Publish Test Report as GitHub PR Comment
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
commit: ${{ github.event.workflow_run.head_sha }}
junit_files: "test-results/**/*.xml"
- name: Publish Test Report in GitHub Actions UI
uses: mikepenz/action-junit-report@v3
with:
commit: ${{github.event.workflow_run.head_sha}}
report_paths: 'test-results/**/*.xml'
fail_on_failure: true
require_tests: true
check_name: Test Results