diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe543c3d..42803019 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,32 +11,80 @@ on: types: [opened, synchronize, reopened, ready_for_review] -jobs: - build: - name: ${{ matrix.os }}-jdk${{ matrix.java }} +jobs: + galleon-plugins-build: + name: galleon-plugins-${{ matrix.os }}-jdk${{ matrix.java }} runs-on: ${{ matrix.os }} + outputs: + galleon-plugins-version: ${{ steps.version.outputs.galleon-plugins-version }} strategy: fail-fast: false matrix: - os: [ubuntu-latest ] + os: [ubuntu-latest] java: ['11', '17'] - steps: - - uses: actions/checkout@v2 - - uses: actions/cache@v1 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + - uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: java-version: ${{ matrix.java }} - - name: Build and Test on ${{ matrix.java }} - run: mvn clean install - - uses: actions/upload-artifact@v2 + distribution: 'temurin' + cache: 'maven' + - name: Build and Test Galleon plugins on ${{ matrix.java }} + run: mvn -U -B -ntp clean install + shell: bash + - id: version + run: echo "galleon-plugins-version=$(mvn -B help:evaluate -Dexpression=project.version -DforceStdout -q)" >> $GITHUB_OUTPUT + - name: Archive the repository + if: matrix.java == '11' + run: | + cd ~ + find ./.m2/repository -type d -name "*SNAPSHOT" -print0 | xargs -0 tar -czf ~/galleon-plugins-maven-repository.tar.gz + - uses: actions/upload-artifact@v3 + if: matrix.java == '11' + with: + name: galleon-plugins-maven-repository + path: ~/galleon-plugins-maven-repository.tar.gz + retention-days: 5 + - name: Upload Test Reports on Failure + uses: actions/upload-artifact@v3 if: failure() with: name: surefire-reports-${{ matrix.os }}-${{ matrix.java }} - path: '**/surefire-reports/*.txt' \ No newline at end of file + path: '**/surefire-reports/*.txt' + + wildfly-build-and-test: + name: Linux/Windows - JDK11 and JDK17 + uses: wildfly/wildfly/.github/workflows/shared-wildfly-build-and-test.yml@main + with: + build-arguments: '-Dversion.org.wildfly.galleon-plugins=${{needs.galleon-plugins-build.outputs.galleon-plugins-version}}' + java-versions: "['11', '17']" + os: "['ubuntu-latest', 'windows-latest']" + maven-repo-name: galleon-plugins-maven-repository + maven-repo-path: galleon-plugins-maven-repository.tar.gz + + needs: galleon-plugins-build + + wildfly-build-and-test-galleon-layers: + name: Galleon Linux - JDK11 + uses: wildfly/wildfly/.github/workflows/shared-wildfly-build-and-test.yml@main + with: + test-arguments: '-Dts.layers -Dts.galleon' + build-arguments: '-Dversion.org.wildfly.galleon-plugins=${{needs.galleon-plugins-build.outputs.galleon-plugins-version}}' + os: "['ubuntu-latest']" + java-versions: "['11']" + maven-repo-name: galleon-plugins-maven-repository + maven-repo-path: galleon-plugins-maven-repository.tar.gz + needs: galleon-plugins-build + + wildfly-build-and-test-preview: + name: WildFly Preview - Linux- JDK17 + uses: wildfly/wildfly/.github/workflows/shared-wildfly-build-and-test.yml@main + with: + test-arguments: '-Dts.preview' + build-arguments: '-Dversion.org.wildfly.galleon-plugins=${{needs.galleon-plugins-build.outputs.galleon-plugins-version}}' + java-versions: "['17']" + os: "['ubuntu-latest']" + maven-repo-name: galleon-plugins-maven-repository + maven-repo-path: galleon-plugins-maven-repository.tar.gz + needs: galleon-plugins-build \ No newline at end of file