New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic CI jobs for examples #2677
Changes from 1 commit
7803b30
85f97ef
92a9ff6
b7985c8
4cef609
b6c59ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: in-container | ||
name: CI-DinD | ||
|
||
on: | ||
pull_request: {} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: CI-Examples | ||
|
||
on: | ||
pull_request: {} | ||
push: { branches: [ master ] } | ||
|
||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
|
||
jobs: | ||
find_gradle_jobs: | ||
runs-on: ubuntu-18.04 | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: '1.8' | ||
- name: Cache Gradle Home files | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-home-testmatrix-examples-${{ hashFiles('**/*.gradle') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle-home-testmatrix-examples- | ||
${{ runner.os }}-gradle-home- | ||
- id: set-matrix | ||
working-directory: ./examples/ | ||
env: | ||
# Since we override the tests executor, | ||
# we should not push empty results to the cache | ||
READ_ONLY_REMOTE_GRADLE_CACHE: true | ||
run: | | ||
TASKS=$(./gradlew --no-daemon --parallel -q testMatrix) | ||
echo $TASKS | ||
echo "::set-output name=matrix::{\"gradle_args\":$TASKS}" | ||
check: | ||
needs: find_gradle_jobs | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJson(needs.find_gradle_jobs.outputs.matrix) }} | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: '1.8' | ||
- name: Cache Gradle Home files | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-home-examples-${{matrix.gradle_args}}_check-${{ hashFiles('**/*.gradle') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle-home-examples-${{matrix.gradle_args}}_check- | ||
${{ runner.os }}-gradle-home-examples-${{matrix.gradle_args}}_check- | ||
${{ runner.os }}-gradle-home-examples- | ||
- name: Clear existing docker image cache | ||
run: docker image prune -af | ||
- name: Build and test Examples with Gradle (${{matrix.gradle_args}}) | ||
working-directory: ./examples/ | ||
run: | | ||
./gradlew --no-daemon --continue --scan --info ${{matrix.gradle_args}} | ||
- name: Aggregate Examples test reports with ciMate | ||
if: always() | ||
env: | ||
CIMATE_PROJECT_ID: 2348n4vl | ||
CIMATE_CI_KEY: "CI / ${{ runner.os }} / ${{matrix.gradle_args}}" | ||
rnorth marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run: | | ||
wget -q https://get.cimate.io/release/linux/cimate | ||
chmod +x cimate | ||
./cimate "**/TEST-*.xml" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
// empty build.gradle for dependabot | ||
apply from: "$rootDir/../gradle/ci-support.gradle" | ||
|
||
subprojects { | ||
apply plugin:"java" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
buildscript { | ||
repositories { | ||
maven { | ||
url "https://plugins.gradle.org/m2/" | ||
} | ||
} | ||
dependencies { | ||
classpath "gradle.plugin.ch.myniva.gradle:s3-build-cache:0.10.0" | ||
classpath "com.gradle.enterprise:com.gradle.enterprise.gradle.plugin:3.2.1" | ||
} | ||
} | ||
|
||
apply plugin: 'ch.myniva.s3-build-cache' | ||
|
||
ext.isMasterBuild = false || | ||
(System.getenv("GITHUB_REF") == "refs/heads/master") || | ||
(System.getenv("BUILD_SOURCEBRANCHNAME") == "master") | ||
|
||
buildCache { | ||
local { | ||
enabled = !isMasterBuild | ||
} | ||
|
||
remote(ch.myniva.gradle.caching.s3.AwsS3BuildCache) { | ||
endpoint = 'fra1.digitaloceanspaces.com' | ||
region = 'fra1' | ||
bucket = 'testcontainers' | ||
path = 'cache' | ||
push = isMasterBuild && !System.getenv("READ_ONLY_REMOTE_GRADLE_CACHE") | ||
headers = [ | ||
'x-amz-acl': 'public-read' | ||
] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,30 +10,9 @@ buildscript { | |
} | ||
} | ||
|
||
apply plugin: 'ch.myniva.s3-build-cache' | ||
apply from: "$rootDir/gradle/remote-cache.gradle" | ||
apply plugin: 'com.gradle.enterprise' | ||
|
||
ext.isMasterBuild = false || | ||
(System.getenv("GITHUB_REF") == "refs/heads/master") || | ||
(System.getenv("BUILD_SOURCEBRANCHNAME") == "master") | ||
|
||
buildCache { | ||
local { | ||
enabled = !isMasterBuild | ||
} | ||
|
||
remote(ch.myniva.gradle.caching.s3.AwsS3BuildCache) { | ||
endpoint = 'fra1.digitaloceanspaces.com' | ||
region = 'fra1' | ||
bucket = 'testcontainers' | ||
path = 'cache' | ||
push = isMasterBuild && !System.getenv("READ_ONLY_REMOTE_GRADLE_CACHE") | ||
headers = [ | ||
'x-amz-acl': 'public-read' | ||
] | ||
} | ||
} | ||
|
||
rootProject.name = 'testcontainers-java' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to be sure - you just moved these lines without changing them, right? Or was it done by accident and we should probably revert it? :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved deliberately; I'm not sure why but it feels right to have these elements near the top of the file, and leave the cache/buildscan related parts at the bottom. |
||
|
||
include "bom" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're not running "Docker-in-Docker", but mount the socket, hence "in-container" :) Maybe we can use "wormhole" or similar...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point