Fixes include when using matrix and strategy build. (#415)
* fixes include directive of strategy build. * Adds test for include and exclude in matrix builds. * ubuntu-16.04 instead of 20.04 * Adds more platforms for runner_test Prevent most "skipping unsupported platform messages". * correct printing for unsupported platform * fix merge
This commit is contained in:
@@ -258,7 +258,10 @@ func (rc *RunContext) isEnabled(ctx context.Context) bool {
|
||||
|
||||
img := rc.platformImage()
|
||||
if img == "" {
|
||||
l.Infof("\U0001F6A7 Skipping unsupported platform '%+v'", job.RunsOn())
|
||||
for _, runnerLabel := range job.RunsOn() {
|
||||
platformName := rc.ExprEval.Interpolate(runnerLabel)
|
||||
l.Infof("\U0001F6A7 Skipping unsupported platform '%+v'", platformName)
|
||||
}
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
@@ -89,6 +89,7 @@ func TestRunEvent(t *testing.T) {
|
||||
{"testdata", "local-action-dockerfile", "push", "", platforms},
|
||||
{"testdata", "local-action-js", "push", "", platforms},
|
||||
{"testdata", "matrix", "push", "", platforms},
|
||||
{"testdata", "matrix-include-exclude", "push", "", platforms},
|
||||
{"testdata", "commands", "push", "", platforms},
|
||||
{"testdata", "workdir", "push", "", platforms},
|
||||
//{"testdata", "issue-228", "push", "", platforms}, // TODO [igni]: Remove this once everything passes
|
||||
|
31
pkg/runner/testdata/matrix-include-exclude/push.yml
vendored
Normal file
31
pkg/runner/testdata/matrix-include-exclude/push.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: matrix-include-exclude
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: PHP ${{ matrix.os }} ${{ matrix.node}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- run: echo ${NODE_VERSION} | grep ${{ matrix.node }}
|
||||
env:
|
||||
NODE_VERSION: ${{ matrix.node }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-18.04, macos-latest]
|
||||
node: [4, 6, 8, 10]
|
||||
exclude:
|
||||
- os: macos-latest
|
||||
node: 4
|
||||
include:
|
||||
- os: ubuntu-16.04
|
||||
node: 10
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node: [8.x, 10.x, 12.x, 13.x]
|
||||
steps:
|
||||
- run: echo ${NODE_VERSION} | grep ${{ matrix.node }}
|
||||
env:
|
||||
NODE_VERSION: ${{ matrix.node }}
|
Reference in New Issue
Block a user