-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom env variables for single and matrix workflows .
Add custom cache and include/exclude for matrix workflow.
- Loading branch information
Showing
3 changed files
with
68 additions
and
7 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 |
---|---|---|
|
@@ -9,9 +9,29 @@ on: | |
scala: | ||
type: string | ||
required: true | ||
include: | ||
type: string | ||
required: false | ||
default: "[]" | ||
exclude: | ||
type: string | ||
required: false | ||
default: "[]" | ||
cmd: | ||
type: string | ||
required: true | ||
env: | ||
type: string | ||
required: false | ||
default: "" | ||
cache-key: | ||
type: string | ||
required: false | ||
default: "" | ||
cache-path: | ||
type: string | ||
required: false | ||
default: "" | ||
|
||
jobs: | ||
cmd: | ||
|
@@ -22,16 +42,29 @@ jobs: | |
matrix: | ||
java: ${{ fromJson(inputs.java) }} | ||
scala: ${{ fromJson(inputs.scala) }} | ||
include: ${{ fromJson(inputs.include) }} | ||
exclude: ${{ fromJson(inputs.exclude) }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
# we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves | ||
fetch-depth: 0 | ||
|
||
- name: Set ENV variables | ||
if: inputs.env != '' | ||
run: echo '${{ inputs.env }}' >> $GITHUB_ENV | ||
|
||
- name: Coursier Cache | ||
uses: coursier/[email protected] | ||
|
||
- name: Custom Cache | ||
uses: actions/cache@v2 | ||
if: ${{ inputs.cache-key != '' && inputs.cache-path != '' }} | ||
with: | ||
key: ${{ inputs.cache-key }} | ||
path: ${{ inputs.cache-path }} | ||
|
||
- name: Install AdoptOpenJDK | ||
uses: coursier/[email protected] | ||
with: | ||
|
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 |
---|---|---|
|
@@ -7,9 +7,17 @@ on: | |
type: string | ||
required: false | ||
default: 8 | ||
scala: | ||
type: string | ||
required: false | ||
default: "" | ||
cmd: | ||
type: string | ||
required: true | ||
env: | ||
type: string | ||
required: false | ||
default: "" | ||
cache-key: | ||
type: string | ||
required: false | ||
|
@@ -30,6 +38,10 @@ jobs: | |
# we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves | ||
fetch-depth: 0 | ||
|
||
- name: Set ENV variables | ||
if: inputs.env != '' | ||
run: echo '${{ inputs.env }}' >> $GITHUB_ENV | ||
|
||
- name: Coursier Cache | ||
uses: coursier/[email protected] | ||
|
||
|
@@ -47,3 +59,5 @@ jobs: | |
|
||
- name: Run sbt command | ||
run: ${{ inputs.cmd }} | ||
env: | ||
SCALA_VERSION: ${{ inputs.scala }} |
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