From b8fab5919b912988390de1e95036a9853e72c94f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Fri, 17 May 2024 06:22:00 +0200 Subject: [PATCH 1/2] Add github verification for SCR This adds a github verification workflow for the scr component of felix dev. --- .github/workflows/maven.yml | 47 ++++++++++++++++++++++++ .github/workflows/publishTestResults.yml | 45 +++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 .github/workflows/maven.yml create mode 100644 .github/workflows/publishTestResults.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000000..85f826e862 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,47 @@ +name: Github CI Build + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + event_file: + name: "Upload Event File" + runs-on: ubuntu-latest + steps: + - name: Upload + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 + with: + name: Event File + path: ${{ github.event_path }} + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Set up Maven + uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5 + with: + maven-version: 3.9.6 + - name: Felix SCR + run: mvn -B -V -Dstyle.color=always --file scr/pom.xml clean verify + - name: Upload Test Results + if: always() + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 + with: + name: test-results + if-no-files-found: warn + path: | + ${{ github.workspace }}/**/target/surefire-reports/*.xml + ${{ github.workspace }}/**/target/failsafe-reports/*.xml diff --git a/.github/workflows/publishTestResults.yml b/.github/workflows/publishTestResults.yml new file mode 100644 index 0000000000..78b649ea2f --- /dev/null +++ b/.github/workflows/publishTestResults.yml @@ -0,0 +1,45 @@ +name: Publish Unit Test Results + +on: + workflow_run: + workflows: ["Github CI Build"] + types: + - completed +permissions: {} + +jobs: + unit-test-results: + name: Unit Test Results + runs-on: ubuntu-latest + if: github.event.workflow_run.conclusion != 'skipped' + + permissions: + checks: write + pull-requests: write + contents: read + issues: read + actions: read + + steps: + - name: Download and Extract Artifacts + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + run: | + mkdir -p artifacts && cd artifacts + + artifacts_url=${{ github.event.workflow_run.artifacts_url }} + + gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact + do + IFS=$'\t' read name url <<< "$artifact" + gh api $url > "$name.zip" + unzip -d "$name" "$name.zip" + done + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@30eadd5010312f995f0d3b3cff7fe2984f69409e # v2.16.1 + with: + commit: ${{ github.event.workflow_run.head_sha }} + event_file: artifacts/Event File/event.json + event_name: ${{ github.event.workflow_run.event }} + junit_files: "artifacts/**/*.xml" From c9fcd94ada59250fc7bf75fa74c209fa9f22f077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Fri, 17 May 2024 08:19:53 +0200 Subject: [PATCH 2/2] Test Workflow --- scr/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scr/pom.xml b/scr/pom.xml index 0cb8f53636..9dec2ba7f0 100644 --- a/scr/pom.xml +++ b/scr/pom.xml @@ -14,7 +14,7 @@ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations - under the License. + under the License. TESTME -->