1
0
Fork 1
mirror of https://github.com/SomboChea/ui synced 2024-06-01 17:15:06 +07:00

chore: adds pull request action (#37)

* chore: improvements in actions

* chore: improvements in actions

* chore: improvements in actions

* chore: aggregates action in a script

* chore: minor fix

* chore: adds node 12 in action

* chore: keep node 12 after 8 10 11

* chore: keep node 12 after 8 10 11

* chore: name fixes
This commit is contained in:
Ayush Sharma 2019-04-27 22:22:53 +02:00 committed by Juan Picado @jotadeveloper
parent 86bda48b79
commit fc114298ad
2 changed files with 76 additions and 52 deletions

118
.github/main.workflow vendored
View File

@ -1,79 +1,93 @@
workflow "build and test" { workflow "build & test" {
resolves = [ resolves = [,
"lint", "node:12"
"test",
"branch-filter",
] ]
on = "push" on = "pull_request"
} }
action "branch-filter" { action "PR:filter" {
uses = "actions/bin/filter@master" uses = "actions/bin/filter@master"
args = "branch" args = "action 'opened|synchronize'"
} }
action "install" { action "node:8" {
needs = ["PR:filter"]
uses = "docker://node:8"
args = "sh scripts/build-test.sh"
}
action "node:10" {
needs = ["PR:filter"]
uses = "docker://node:10" uses = "docker://node:10"
args = "yarn install" args = "sh scripts/build-test.sh"
} }
action "build" { action "node:11" {
uses = "docker://node:10" needs = ["PR:filter"]
needs = ["install"] uses = "docker://node:11"
args = "yarn run build" args = "sh scripts/build-test.sh"
} }
action "lint" { action "node:12" {
uses = "docker://node:10" needs = [
needs = ["install"] "node:8",
args = "yarn run lint" "node:10",
"node:11"
]
uses = "docker://node:12"
args = "sh scripts/build-test.sh"
} }
action "test" { workflow "build, test & release" {
uses = "docker://node:10"
needs = ["build"]
args = "yarn run test"
}
workflow "release" {
resolves = [ resolves = [
"github-release", "github-release"
"release:lint",
] ]
on = "push" on = "push"
} }
action "release:tag-filter" { action "push:node:8" {
uses = "docker://node:8"
args = "sh scripts/build-test.sh"
}
action "push:node:10" {
uses = "docker://node:10"
args = "sh scripts/build-test.sh"
}
action "push:node:11" {
uses = "docker://node:11"
args = "sh scripts/build-test.sh"
}
action "push:node:12" {
needs = [
"push:node:8",
"push:node:10",
"push:node:11",
]
uses = "docker://node:12"
args = "sh scripts/build-test.sh"
}
action "release:filter" {
needs = [
"push:node:12"
]
uses = "actions/bin/filter@master" uses = "actions/bin/filter@master"
args = "tag v*" args = "tag v*"
} }
action "release:install" { action "release:authorization" {
uses = "docker://node:10" needs = ["release:filter"]
needs = ["release:tag-filter"] uses = "actions/bin/filter@master"
args = "yarn install" args = ["actor", "ayusharma", "juanpicado"]
}
action "release:build" {
uses = "docker://node:10"
needs = ["release:install"]
args = "yarn run build"
}
action "release:lint" {
uses = "docker://node:10"
needs = ["release:install"]
args = "yarn run lint"
}
action "release:test" {
uses = "docker://node:10"
needs = ["release:build"]
args = "yarn run test"
} }
action "release:publish" { action "release:publish" {
needs = ["release:test"] needs = [
"release:authorization"
]
uses = "docker://node:10" uses = "docker://node:10"
args = "sh scripts/publish.sh" args = "sh scripts/publish.sh"
secrets = [ secrets = [
@ -91,4 +105,4 @@ action "github-release" {
secrets = [ secrets = [
"GITHUB_TOKEN", "GITHUB_TOKEN",
] ]
} }

10
scripts/build-test.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
yarn install
yarn run build
yarn run lint
yarn run test