mirror of
https://github.com/docker/actions-toolkit.git
synced 2024-11-23 03:16:09 +08:00
chore: rename e2e to itg tests
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
4fcbf75fc4
commit
49bde5a54a
84
.github/workflows/e2e.yml
vendored
84
.github/workflows/e2e.yml
vendored
@ -1,84 +0,0 @@
|
|||||||
name: e2e
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
pull_request:
|
|
||||||
paths-ignore:
|
|
||||||
- '.github/*-releases.json'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
prepare:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
matrix: ${{ steps.tests.outputs.matrix }}
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
-
|
|
||||||
name: Setup Node
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 16
|
|
||||||
cache: 'yarn'
|
|
||||||
-
|
|
||||||
name: Install
|
|
||||||
run: yarn install
|
|
||||||
-
|
|
||||||
name: Create matrix
|
|
||||||
id: tests
|
|
||||||
run: |
|
|
||||||
declare -a tests
|
|
||||||
for test in $(yarn run test:e2e-list); do
|
|
||||||
tests+=("${test#$(pwd)/__tests__/}")
|
|
||||||
done
|
|
||||||
echo "matrix=$(echo ${tests[@]} | jq -cR 'split(" ")')" >>${GITHUB_OUTPUT}
|
|
||||||
-
|
|
||||||
name: Show matrix
|
|
||||||
run: |
|
|
||||||
echo ${{ steps.tests.outputs.matrix }}
|
|
||||||
|
|
||||||
test:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
needs:
|
|
||||||
- prepare
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
test: ${{ fromJson(needs.prepare.outputs.matrix) }}
|
|
||||||
os:
|
|
||||||
- ubuntu-latest
|
|
||||||
- macos-latest
|
|
||||||
- windows-latest
|
|
||||||
exclude:
|
|
||||||
- os: macos-latest
|
|
||||||
test: buildx/bake.test.e2e.ts
|
|
||||||
- os: windows-latest
|
|
||||||
test: buildx/bake.test.e2e.ts
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
-
|
|
||||||
name: Setup Node
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 16
|
|
||||||
cache: 'yarn'
|
|
||||||
-
|
|
||||||
name: Install
|
|
||||||
run: yarn install
|
|
||||||
-
|
|
||||||
name: Test
|
|
||||||
run: yarn test-coverage:e2e --runTestsByPath __tests__/${{ matrix.test }} --coverageDirectory=./coverage
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
-
|
|
||||||
name: Upload coverage
|
|
||||||
uses: codecov/codecov-action@v3
|
|
||||||
with:
|
|
||||||
file: ./coverage/clover.xml
|
|
||||||
flags: e2e
|
|
74
.github/workflows/test.yml
vendored
74
.github/workflows/test.yml
vendored
@ -1,6 +1,7 @@
|
|||||||
name: test
|
name: test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- 'main'
|
||||||
@ -47,3 +48,76 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
file: ./coverage/clover.xml
|
file: ./coverage/clover.xml
|
||||||
flags: unit
|
flags: unit
|
||||||
|
|
||||||
|
prepare-itg:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
matrix: ${{ steps.tests.outputs.matrix }}
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
-
|
||||||
|
name: Setup Node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
cache: 'yarn'
|
||||||
|
-
|
||||||
|
name: Install
|
||||||
|
run: yarn install
|
||||||
|
-
|
||||||
|
name: Create matrix
|
||||||
|
id: tests
|
||||||
|
run: |
|
||||||
|
declare -a tests
|
||||||
|
for test in $(yarn run test:itg-list); do
|
||||||
|
tests+=("${test#$(pwd)/__tests__/}")
|
||||||
|
done
|
||||||
|
echo "matrix=$(echo ${tests[@]} | jq -cR 'split(" ")')" >>${GITHUB_OUTPUT}
|
||||||
|
-
|
||||||
|
name: Show matrix
|
||||||
|
run: |
|
||||||
|
echo ${{ steps.tests.outputs.matrix }}
|
||||||
|
|
||||||
|
test-itg:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
needs:
|
||||||
|
- prepare-itg
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
test: ${{ fromJson(needs.prepare-itg.outputs.matrix) }}
|
||||||
|
os:
|
||||||
|
- ubuntu-latest
|
||||||
|
- macos-latest
|
||||||
|
- windows-latest
|
||||||
|
exclude:
|
||||||
|
- os: macos-latest
|
||||||
|
test: buildx/bake.test.itg.ts
|
||||||
|
- os: windows-latest
|
||||||
|
test: buildx/bake.test.itg.ts
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
-
|
||||||
|
name: Setup Node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
cache: 'yarn'
|
||||||
|
-
|
||||||
|
name: Install
|
||||||
|
run: yarn install
|
||||||
|
-
|
||||||
|
name: Test
|
||||||
|
run: yarn test:itg-coverage --runTestsByPath __tests__/${{ matrix.test }} --coverageDirectory=./coverage
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
-
|
||||||
|
name: Upload coverage
|
||||||
|
uses: codecov/codecov-action@v3
|
||||||
|
with:
|
||||||
|
file: ./coverage/clover.xml
|
||||||
|
flags: itg
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
[![Downloads](https://img.shields.io/npm/dw/@docker/actions-toolkit?logo=npm&style=flat-square)](https://www.npmjs.com/package/@docker/actions-toolkit)
|
[![Downloads](https://img.shields.io/npm/dw/@docker/actions-toolkit?logo=npm&style=flat-square)](https://www.npmjs.com/package/@docker/actions-toolkit)
|
||||||
[![Build workflow](https://img.shields.io/github/actions/workflow/status/docker/actions-toolkit/build.yml?label=build&logo=github&style=flat-square)](https://github.com/docker/actions-toolkit/actions?workflow=build)
|
[![Build workflow](https://img.shields.io/github/actions/workflow/status/docker/actions-toolkit/build.yml?label=build&logo=github&style=flat-square)](https://github.com/docker/actions-toolkit/actions?workflow=build)
|
||||||
[![Test workflow](https://img.shields.io/github/actions/workflow/status/docker/actions-toolkit/test.yml?label=test&logo=github&style=flat-square)](https://github.com/docker/actions-toolkit/actions?workflow=test)
|
[![Test workflow](https://img.shields.io/github/actions/workflow/status/docker/actions-toolkit/test.yml?label=test&logo=github&style=flat-square)](https://github.com/docker/actions-toolkit/actions?workflow=test)
|
||||||
[![E2E workflow](https://img.shields.io/github/actions/workflow/status/docker/actions-toolkit/e2e.yml?label=e2e&logo=github&style=flat-square)](https://github.com/docker/actions-toolkit/actions?workflow=e2e)
|
|
||||||
[![Codecov](https://img.shields.io/codecov/c/github/docker/actions-toolkit?logo=codecov&style=flat-square)](https://codecov.io/gh/docker/actions-toolkit)
|
[![Codecov](https://img.shields.io/codecov/c/github/docker/actions-toolkit?logo=codecov&style=flat-square)](https://codecov.io/gh/docker/actions-toolkit)
|
||||||
|
|
||||||
# Actions Toolkit
|
# Actions Toolkit
|
||||||
|
@ -79,7 +79,7 @@ RUN --mount=type=bind,target=.,rw \
|
|||||||
--mount=type=bind,from=buildx,source=/buildx,target=/usr/libexec/docker/cli-plugins/docker-buildx \
|
--mount=type=bind,from=buildx,source=/buildx,target=/usr/libexec/docker/cli-plugins/docker-buildx \
|
||||||
--mount=type=bind,from=buildx,source=/buildx,target=/usr/bin/buildx \
|
--mount=type=bind,from=buildx,source=/buildx,target=/usr/bin/buildx \
|
||||||
--mount=type=secret,id=GITHUB_TOKEN \
|
--mount=type=secret,id=GITHUB_TOKEN \
|
||||||
GITHUB_TOKEN=$(cat /run/secrets/GITHUB_TOKEN) yarn run test-coverage --coverageDirectory=/tmp/coverage
|
GITHUB_TOKEN=$(cat /run/secrets/GITHUB_TOKEN) yarn run test:coverage --coverageDirectory=/tmp/coverage
|
||||||
|
|
||||||
FROM scratch AS test-coverage
|
FROM scratch AS test-coverage
|
||||||
COPY --from=test /tmp/coverage /
|
COPY --from=test /tmp/coverage /
|
||||||
|
@ -19,7 +19,7 @@ module.exports = {
|
|||||||
testEnvironment: 'node',
|
testEnvironment: 'node',
|
||||||
moduleFileExtensions: ['js', 'ts'],
|
moduleFileExtensions: ['js', 'ts'],
|
||||||
setupFiles: ['dotenv/config'],
|
setupFiles: ['dotenv/config'],
|
||||||
testMatch: ['**/*.test.e2e.ts'],
|
testMatch: ['**/*.test.itg.ts'],
|
||||||
testTimeout: 1800000, // 30 minutes
|
testTimeout: 1800000, // 30 minutes
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.ts$': 'ts-jest'
|
'^.+\\.ts$': 'ts-jest'
|
@ -11,10 +11,10 @@
|
|||||||
"prettier": "prettier --check \"./**/*.ts\"",
|
"prettier": "prettier --check \"./**/*.ts\"",
|
||||||
"prettier:fix": "prettier --write \"./**/*.ts\"",
|
"prettier:fix": "prettier --write \"./**/*.ts\"",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"test:e2e": "jest -c jest.config.e2e.ts --runInBand --detectOpenHandles",
|
"test:coverage": "jest --coverage",
|
||||||
"test:e2e-list": "jest -c jest.config.e2e.ts --listTests",
|
"test:itg": "jest -c jest.config.itg.ts --runInBand --detectOpenHandles",
|
||||||
"test-coverage": "jest --coverage",
|
"test:itg-list": "jest -c jest.config.itg.ts --listTests",
|
||||||
"test-coverage:e2e": "jest --coverage -c jest.config.e2e.ts --runInBand --detectOpenHandles"
|
"test:itg-coverage": "jest --coverage -c jest.config.itg.ts --runInBand --detectOpenHandles"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
Loading…
Reference in New Issue
Block a user