Skip to content

Commit 092db8b

Browse files
authored
feat: support mysql_version matrix (#3)
* Update node-test-mysql.yml feat: support mysql_version matrix * matrxi add mysql_version * fix: mysql_version * resolve output
1 parent 0a554f1 commit 092db8b

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.github/workflows/node-test-mysql.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
outputs:
3535
os: ${{ steps.handler.outputs.os }}
3636
version: ${{ steps.handler.outputs.version }}
37+
mysql_version: ${{ steps.handler.outputs.mysql_version }}
3738

3839
steps:
3940
# Checkout action repository
@@ -60,6 +61,7 @@ jobs:
6061
env:
6162
INPUT_OS: ${{ inputs.os }}
6263
INPUT_VERSION: ${{ inputs.version }}
64+
INPUT_MYSQL_VERSION: {{ inputs.mysql_version }}
6365

6466
Test:
6567
needs: Setup
@@ -68,13 +70,14 @@ jobs:
6870
matrix:
6971
os: ${{ fromJSON(needs.setup.outputs.os) }}
7072
version: ${{ fromJSON(needs.setup.outputs.version) }}
73+
mysql_version: ${{ fromJSON(needs.setup.outputs.mysql_version) }}
7174

72-
name: Test (${{ matrix.os }}, ${{ matrix.version }})
75+
name: Test (${{ matrix.os }}, ${{ matrix.version }}, ${{ matrix.mysql_version }})
7376
runs-on: ${{ matrix.os }}
7477

7578
services:
7679
mysql:
77-
image: mysql:${{ inputs.mysql_version }}
80+
image: mysql:${{ matrix.mysql_version }}
7881
env:
7982
MYSQL_ALLOW_EMPTY_PASSWORD: true
8083
MYSQL_DATABASE: test
@@ -90,7 +93,7 @@ jobs:
9093
- 6379:6379
9194

9295
concurrency:
93-
group: ${{ github.workflow }}-#${{ github.event.pull_request.number || github.ref }}-(${{ matrix.os }}, ${{ matrix.version }})
96+
group: ${{ github.workflow }}-#${{ github.event.pull_request.number || github.ref }}-(${{ matrix.os }}, ${{ matrix.version }}, ${{ matrix.mysql_version }})
9497
cancel-in-progress: true
9598

9699
steps:

scripts/test/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ const core = require('@actions/core');
22

33
const os = core.getInput('os').split(',').map(x => x.trim());
44
const version = core.getInput('version').split(',').map(x => x.trim());
5+
const mysqlVersion = core.getInput('mysql_version').split(',').map(x => x.trim());
56

67
core.setOutput('os', JSON.stringify(os));
78
core.setOutput('version', JSON.stringify(version));
9+
core.setOutput('mysql_version', JSON.stringify(mysqlVersion));
810

9-
core.info(`os: ${os}, version: ${version}`);
11+
core.info(`os: ${os}, version: ${version}, mysql_version: ${mysqlVersion}`);

0 commit comments

Comments
 (0)