mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-25 06:20:42 +01:00
github.head_ref is empty on tag pushes and manual runs (every run then shares one group and cancels the last) and collides across forks when two PRs share a branch name. pull_request.number is unique per PR; github.ref covers push/tag/dispatch. Applied to all workflows using the pattern, including pre-existing ones. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
63 lines
1.6 KiB
YAML
63 lines
1.6 KiB
YAML
name: Java Client Unit Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
paths:
|
|
- 'other/java/**'
|
|
- '.github/workflows/java_unit_tests.yml'
|
|
pull_request:
|
|
branches: [ master ]
|
|
paths:
|
|
- 'other/java/**'
|
|
- '.github/workflows/java_unit_tests.yml'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test:
|
|
name: Java Unit Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
java: ['8', '11', '17', '21']
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Set up Java
|
|
uses: actions/setup-java@v6
|
|
with:
|
|
java-version: ${{ matrix.java }}
|
|
distribution: 'temurin'
|
|
cache: 'maven'
|
|
|
|
- name: Build and Install SeaweedFS Client
|
|
working-directory: other/java/client
|
|
run: |
|
|
mvn clean install -DskipTests -Dmaven.javadoc.skip=true -Dgpg.skip=true
|
|
|
|
- name: Run Client Unit Tests
|
|
working-directory: other/java/client
|
|
run: |
|
|
mvn test -Dtest=SeaweedReadTest,SeaweedCipherTest
|
|
|
|
- name: Run HDFS3 Configuration Tests
|
|
working-directory: other/java/hdfs3
|
|
run: |
|
|
mvn test -Dtest=SeaweedFileSystemConfigTest -Dmaven.javadoc.skip=true -Dgpg.skip=true
|
|
|
|
- name: Upload Test Reports
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: test-reports-java-${{ matrix.java }}
|
|
path: |
|
|
other/java/client/target/surefire-reports/
|
|
other/java/hdfs3/target/surefire-reports/
|
|
|