forked from netty/netty
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use matrix for job configurations (netty#10889)
Motivation: We can use the matrix feature to define our jobs. This reduces a lot of config Modification: Use job matrix Result: Easier to maintain
- Loading branch information
1 parent
1a708ac
commit 78fcd5c
Showing
2 changed files
with
44 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,16 +11,29 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
build-linux-x86_64-java8: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- setup: linux-x86_64-java8 | ||
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml build" | ||
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml run build" | ||
- setup: linux-x86_64-java11 | ||
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build" | ||
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build" | ||
- setup: linux-x86_64-java15 | ||
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.115.yaml build" | ||
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.115.yaml run build" | ||
|
||
name: ${{ matrix.setup }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Cache .m2/repository | ||
- uses: actions/cache@v2 | ||
env: | ||
cache-name: build-linux-x86_64-java8-cache-m2-repository | ||
cache-name: build-${{ matrix.setup }}-cache-m2-repository | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} | ||
|
@@ -32,87 +45,15 @@ jobs: | |
- uses: satackey/[email protected] | ||
continue-on-error: true | ||
with: | ||
key: build-linux-x86_64-java8-docker-cache-{hash} | ||
key: build-${{ matrix.setup }}-docker-cache-{hash} | ||
restore-keys: | | ||
build-linux-x86_64-java8-docker-cache- | ||
build-${{ matrix.setup }}-docker-cache- | ||
- name: Build docker image | ||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml build | ||
run: docker-compose ${{ matrix.docker-compose-build }} | ||
|
||
- name: Build project without leak detection | ||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml run build | ||
|
||
- uses: actions/upload-artifact@v2 | ||
if: ${{ failure() }} | ||
with: | ||
name: target | ||
path: "**/target/" | ||
|
||
build-linux-x86_64-java11: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Cache .m2/repository | ||
- uses: actions/cache@v2 | ||
env: | ||
cache-name: build-linux-x86_64-java11-cache-m2-repository | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
# Enable caching of Docker layers | ||
- uses: satackey/[email protected] | ||
continue-on-error: true | ||
with: | ||
key: build-linux-x86_64-java11-docker-cache-{hash} | ||
restore-keys: | | ||
build-linux-x86_64-java11-docker-cache- | ||
- name: Build docker image | ||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build | ||
|
||
- name: Build project without leak detection | ||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build | ||
|
||
- uses: actions/upload-artifact@v2 | ||
if: ${{ failure() }} | ||
with: | ||
name: target | ||
path: "**/target/" | ||
|
||
build-linux-x86_64-java15: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Cache .m2/repository | ||
- uses: actions/cache@v2 | ||
env: | ||
cache-name: build-linux-x86_64-java15-cache-m2-repository | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
# Enable caching of Docker layers | ||
- uses: satackey/[email protected] | ||
continue-on-error: true | ||
with: | ||
key: build-linux-x86_64-java15-docker-cache-{hash} | ||
restore-keys: | | ||
build-linux-x86_64-java15-docker-cache- | ||
- name: Build docker image | ||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.115.yaml build | ||
|
||
- name: Build project without leak detection | ||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.115.yaml run build | ||
run: docker-compose ${{ matrix.docker-compose-run }} | ||
|
||
- uses: actions/upload-artifact@v2 | ||
if: ${{ failure() }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,16 +33,33 @@ jobs: | |
- name: Verify with Maven | ||
run: mvn verify -B --file pom.xml -DskipTests=true | ||
|
||
build-linux-x86_64-java8: | ||
build-pr: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- setup: linux-x86_64-java8 | ||
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml build" | ||
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml run build-leak" | ||
- setup: linux-x86_64-java11 | ||
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build" | ||
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build-leak" | ||
- setup: linux-x86_64-java15 | ||
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.115.yaml build" | ||
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.115.yaml run build-leak" | ||
- setup: linux-x86_64-java11-boringssl | ||
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build" | ||
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build-leak-boringssl-static" | ||
|
||
name: ${{ matrix.setup }} | ||
needs: verify | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Cache .m2/repository | ||
- uses: actions/cache@v2 | ||
env: | ||
cache-name: build-linux-x86_64-java8-cache-m2-repository | ||
cache-name: build-${{ matrix.setup }}-cache-m2-repository | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-pr-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} | ||
|
@@ -54,141 +71,22 @@ jobs: | |
- uses: satackey/[email protected] | ||
continue-on-error: true | ||
with: | ||
key: build-linux-x86_64-java8-docker-cache-{hash} | ||
key: build-${{ matrix.setup }}-docker-cache-{hash} | ||
restore-keys: | | ||
build-linux-x86_64-java8-docker-cache- | ||
build-${{ matrix.setup }}-docker-cache- | ||
- name: Build docker image | ||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml build | ||
run: docker-compose ${{ matrix.docker-compose-build }} | ||
|
||
- name: Build project with leak detection | ||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml run build-leak | tee build-leak.output | ||
run: docker-compose ${{ matrix.docker-compose-run }} | tee build-leak.output | ||
|
||
- name: Checking for detected leak | ||
run: ./.github/scripts/check_leak.sh build-leak.output | ||
|
||
- uses: actions/upload-artifact@v2 | ||
if: ${{ failure() }} | ||
with: | ||
name: target | ||
name: build-${{ matrix.setup }}-target | ||
path: "**/target/" | ||
|
||
build-linux-x86_64-java11: | ||
runs-on: ubuntu-latest | ||
needs: verify | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Cache .m2/repository | ||
- uses: actions/cache@v2 | ||
env: | ||
cache-name: build-linux-x86_64-java11-cache-m2-repository | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-pr-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pr-${{ env.cache-name }}- | ||
${{ runner.os }}-pr- | ||
# Enable caching of Docker layers | ||
- uses: satackey/[email protected] | ||
continue-on-error: true | ||
with: | ||
key: build-linux-x86_64-java11-docker-cache-{hash} | ||
restore-keys: | | ||
build-linux-x86_64-java11-docker-cache- | ||
- name: Build docker image | ||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build | ||
|
||
- name: Build project with leak detection | ||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build-leak | tee build-leak.output | ||
|
||
- name: Checking for detected leak | ||
run: ./.github/scripts/check_leak.sh build-leak.output | ||
|
||
- uses: actions/upload-artifact@v2 | ||
if: ${{ failure() }} | ||
with: | ||
name: target | ||
path: "**/target/" | ||
|
||
build-linux-x86_64-java15: | ||
runs-on: ubuntu-latest | ||
needs: verify | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Cache .m2/repository | ||
- uses: actions/cache@v2 | ||
env: | ||
cache-name: build-linux-x86_64-java15-cache-m2-repository | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-pr-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pr-${{ env.cache-name }}- | ||
${{ runner.os }}-pr- | ||
# Enable caching of Docker layers | ||
- uses: satackey/[email protected] | ||
continue-on-error: true | ||
with: | ||
key: build-linux-x86_64-java15-docker-cache-{hash} | ||
restore-keys: | | ||
build-linux-x86_64-java15-docker-cache- | ||
- name: Build docker image | ||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.115.yaml build | ||
|
||
- name: Build project with leak detection | ||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.115.yaml run build-leak | tee build-leak.output | ||
|
||
- name: Checking for detected leak | ||
run: ./.github/scripts/check_leak.sh build-leak.output | ||
|
||
- uses: actions/upload-artifact@v2 | ||
if: ${{ failure() }} | ||
with: | ||
name: target | ||
path: "**/target/" | ||
|
||
build-linux-x86_64-java11-boringssl: | ||
runs-on: ubuntu-latest | ||
needs: verify | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Cache .m2/repository | ||
- uses: actions/cache@v2 | ||
env: | ||
cache-name: build-linux-x86_64-java11-boringssl-cache-m2-repository | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-pr-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pr-${{ env.cache-name }}- | ||
${{ runner.os }}-pr- | ||
# Enable caching of Docker layers | ||
- uses: satackey/[email protected] | ||
continue-on-error: true | ||
with: | ||
key: build-linux-x86_64-java11-boringssl-docker-cache-{hash} | ||
restore-keys: | | ||
build-linux-x86_64-java11-boringssl-docker-cache- | ||
- name: Build docker image | ||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build | ||
|
||
- name: Build project with leak detection | ||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build-leak-boringssl-static | tee build-leak.output | ||
|
||
- name: Checking for detected leak | ||
run: ./.github/scripts/check_leak.sh build-leak.output | ||
|
||
- uses: actions/upload-artifact@v2 | ||
if: ${{ failure() }} | ||
with: | ||
name: target | ||
path: "**/target/" |