Skip to content

Commit

Permalink
ci: test on pull requests from forks
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Mar 5, 2019
1 parent 507340a commit ba82e07
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions .github/main.workflow
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,42 @@ action "Preview" {
secrets = ["GITHUB_TOKEN"]
}

workflow "Test" {
workflow "Test on push" {
on = "push"
resolves = ["npm test"]
resolves = ["npm test (push)"]
}

action "npm ci" {
action "npm ci (push)" {
uses = "docker://node:alpine"
runs = "npm"
args = "ci"
}

action "npm test" {
needs = "npm ci"
action "npm test (push)" {
needs = "npm ci (push)"
uses = "docker://node:alpine"
runs = "npm"
args = "test"
}

workflow "Test on pull_request" {
on = "pull_request"
resolves = ["npm test (pull request)"]
}

action "checkout pull request" {
uses = "gr2m/git-checkout-pull-request-action@master"
}

action "npm ci (pull request)" {
needs = "checkout pull request"
uses = "docker://node:alpine"
runs = "npm"
args = "ci"
}

action "npm test (pull request)" {
needs = "npm ci (pull request)"
uses = "docker://node:alpine"
runs = "npm"
args = "test"
Expand All @@ -43,7 +66,7 @@ workflow "Release" {
}

action "filter: master branch" {
needs = "npm test"
needs = "npm test (push)"
uses = "actions/bin/filter@master"
args = "branch master"
}
Expand Down

0 comments on commit ba82e07

Please sign in to comment.