-
Notifications
You must be signed in to change notification settings - Fork 109
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
Add example on how to use matrix
with env vars
#1288
base: master
Are you sure you want to change the base?
Conversation
d8fe4d5
to
0d60926
Compare
Hmm, I also expected this to generate 4 tasks, but it generates 16: blah_task:
name: Build
container:
image: alpine:3.20
env:
# Android Command-line tools were obtained with https://stackoverflow.com/a/78890086/7009800
matrix:
ANDROID_CLT_VERSION: 9123335 # v8, latest compatible with JDK 8+
JDK_PACKAGE: openjdk-8-jdk
matrix:
ANDROID_CLT_VERSION: 9862592 # v10, latest compatible with JDK 11+
JDK_PACKAGE: openjdk-11-jdk
matrix:
ANDROID_CLT_VERSION: 11479570 # v13, latest compatible with JDK 17+
JDK_PACKAGE: openjdk-17-jdk
matrix:
ANDROID_CLT_VERSION: 11479570 # v13, latest compatible with JDK 17+
JDK_PACKAGE: openjdk-21-jdk
info_script:
- echo "Building Android SDK with Android Command-line tools $ANDROID_CLT_VERSION and JDK $JDK_PACKAGE" There's an easy workaround in this case though workaroundblah_task:
name: Build
container:
image: alpine:3.20
env:
# Android Command-line tools were obtained with https://stackoverflow.com/a/78890086/7009800
matrix:
# v8, latest compatible with JDK 8+
ANDROID_AND_JDK: 9123335:openjdk-8-jdk
# v10, latest compatible with JDK 11+
ANDROID_AND_JDK: 9862592:openjdk-11-jdk
# v13, latest compatible with JDK 17+
ANDROID_AND_JDK: 11479570:openjdk-17-jdk
# v13, latest compatible with JDK 17+
ANDROID_AND_JDK: 11479570:openjdk-21-jdk
export_env_vars_script:
- export ANDROID_CLT_VERSION="$(echo $ANDROID_AND_JDK | cut -d ':' -f1)"
- export JDK_PACKAGE="$(echo $ANDROID_AND_JDK | cut -d ':' -f2)"
- echo "ANDROID_CLT_VERSION=$ANDROID_CLT_VERSION" >> $CIRRUS_ENV
- echo "JDK_PACKAGE=$JDK_PACKAGE" >> $CIRRUS_ENV
info_script:
- echo "Building Android SDK with Android Command-line tools $ANDROID_CLT_VERSION and JDK $JDK_PACKAGE" |
This should work: blah_task:
name: Build
container:
image: alpine:3.20
env:
# Android Command-line tools were obtained with https://stackoverflow.com/a/78890086/7009800
matrix:
- ANDROID_CLT_VERSION: 9123335 # v8, latest compatible with JDK 8+
JDK_PACKAGE: openjdk-8-jdk
- ANDROID_CLT_VERSION: 9862592 # v10, latest compatible with JDK 11+
JDK_PACKAGE: openjdk-11-jdk
- ANDROID_CLT_VERSION: 11479570 # v13, latest compatible with JDK 17+
JDK_PACKAGE: openjdk-17-jdk
- ANDROID_CLT_VERSION: 11479570 # v13, latest compatible with JDK 17+
JDK_PACKAGE: openjdk-21-jdk
info_script:
- echo "Building Android SDK with Android Command-line tools $ANDROID_CLT_VERSION and JDK $JDK_PACKAGE" Regarding the PR itself, perhaps it should use this syntax too. |
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.
See #1288 (comment).
I think the current way is better to generate 6 tasks - less duplication is involved. I added another example to make it clear that matrix env vars can be also configured on a fine-grained level, just like you showed in #1288 (comment) |
It seems that the "Spell Check" is failing because |
Thanks, fixed. btw, it seems that the tool used for spellchecking hasn't seen a commit to master in ~4 years, and the latest version is ~7 years old. |
took me too long to figure this out