mirror of
https://github.com/docker/actions-toolkit.git
synced 2024-11-27 06:46:07 +08:00
Merge pull request #488 from crazy-max/test-node-multi
ci: test supported node versions
This commit is contained in:
commit
d99f9fda4d
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
@ -15,6 +15,12 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node_version:
|
||||
- 20
|
||||
- 18
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
@ -24,3 +30,5 @@ jobs:
|
||||
uses: docker/bake-action@v5
|
||||
with:
|
||||
targets: build
|
||||
env:
|
||||
NODE_VERSION: ${{ matrix.node_version }}
|
||||
|
9
.github/workflows/test.yml
vendored
9
.github/workflows/test.yml
vendored
@ -21,6 +21,12 @@ env:
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node_version:
|
||||
- 20
|
||||
- 18
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
@ -32,6 +38,7 @@ jobs:
|
||||
targets: test-coverage
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NODE_VERSION: ${{ matrix.node_version }}
|
||||
-
|
||||
name: Check coverage
|
||||
run: |
|
||||
@ -44,7 +51,7 @@ jobs:
|
||||
-
|
||||
name: Upload coverage
|
||||
uses: codecov/codecov-action@v5
|
||||
if: env.RUN_CODECOV == 'true'
|
||||
if: env.RUN_CODECOV == 'true' && matrix.node_version == env.NODE_VERSION
|
||||
with:
|
||||
files: ./coverage/clover.xml
|
||||
flags: unit
|
||||
|
@ -12,6 +12,10 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
variable "NODE_VERSION" {
|
||||
default = null
|
||||
}
|
||||
|
||||
group "default" {
|
||||
targets = ["build"]
|
||||
}
|
||||
@ -24,31 +28,42 @@ group "validate" {
|
||||
targets = ["lint", "vendor-validate", "dockerfile-validate", "license-validate"]
|
||||
}
|
||||
|
||||
target "_common" {
|
||||
args = {
|
||||
NODE_VERSION = NODE_VERSION
|
||||
}
|
||||
}
|
||||
|
||||
target "build" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "build-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "format" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "format-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "lint" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "lint"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "vendor" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "vendor-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "vendor-validate" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "vendor-validate"
|
||||
output = ["type=cacheonly"]
|
||||
@ -67,6 +82,7 @@ target "dockerfile-validate" {
|
||||
}
|
||||
|
||||
target "test" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "test"
|
||||
output = ["type=cacheonly"]
|
||||
@ -74,6 +90,7 @@ target "test" {
|
||||
}
|
||||
|
||||
target "test-coverage" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "test-coverage"
|
||||
output = ["./coverage"]
|
||||
@ -87,6 +104,7 @@ variable "GITHUB_REF" {
|
||||
}
|
||||
|
||||
target "publish" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
args = {
|
||||
GITHUB_REF = GITHUB_REF
|
||||
|
Loading…
Reference in New Issue
Block a user