2023-01-17 19:07:30 +08:00
|
|
|
name: test
|
|
|
|
|
2023-03-26 20:30:33 +08:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2023-01-17 19:07:30 +08:00
|
|
|
on:
|
2023-03-26 05:01:00 +08:00
|
|
|
workflow_dispatch:
|
2023-01-17 19:07:30 +08:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
pull_request:
|
2023-01-31 09:35:21 +08:00
|
|
|
paths-ignore:
|
2023-03-03 02:16:57 +08:00
|
|
|
- '.github/*-releases.json'
|
2023-01-17 19:07:30 +08:00
|
|
|
|
|
|
|
jobs:
|
2023-01-31 03:30:44 +08:00
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 06:40:48 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-01-17 19:07:30 +08:00
|
|
|
-
|
|
|
|
name: Test
|
2023-09-13 06:12:39 +08:00
|
|
|
uses: docker/bake-action@v4
|
2023-01-17 19:07:30 +08:00
|
|
|
with:
|
2023-01-23 08:38:28 +08:00
|
|
|
targets: test-coverage
|
2023-01-24 07:29:03 +08:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-02-04 11:42:47 +08:00
|
|
|
-
|
|
|
|
name: Upload coverage
|
|
|
|
uses: codecov/codecov-action@v3
|
|
|
|
with:
|
|
|
|
file: ./coverage/clover.xml
|
2023-03-01 03:55:32 +08:00
|
|
|
flags: unit
|
2023-03-26 05:01:00 +08:00
|
|
|
|
|
|
|
prepare-itg:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
matrix: ${{ steps.tests.outputs.matrix }}
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-09-05 06:40:48 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-03-26 05:01:00 +08:00
|
|
|
-
|
|
|
|
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
|
2023-09-05 06:40:48 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-03-26 05:01:00 +08:00
|
|
|
-
|
|
|
|
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
|