From 6645b3b133ef785c8f8fa4135cb6a703e241192e Mon Sep 17 00:00:00 2001 From: Tom Tseng Date: Wed, 18 Oct 2023 18:23:29 +0800 Subject: [PATCH] CI: fix node.js.yml to set up DB --- .github/workflows/node.js.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 550798fb3..9437df93f 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -17,6 +17,17 @@ jobs: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: + - uses: mirromutth/mysql-action@v1.1 + with: + host port: 3800 # Optional, default value is 3306. The port of host + container port: 3307 # Optional, default value is 3306. The port of container + character set server: 'utf8' # Optional, default value is 'utf8mb4'. The '--character-set-server' option for mysqld + collation server: 'utf8_general_ci' # Optional, default value is 'utf8mb4_general_ci'. The '--collation-server' option for mysqld + mysql version: '8.0' # Optional, default value is "latest". The version of the MySQL + mysql database: 'library' # Optional, default value is "test". The specified database which will be create + mysql root password: ${{ secrets.DB_PASS }} # Required if "mysql user" is empty, default is empty. The root superuser password + # mysql user: 'developer' # Required if "mysql root password" is empty, default is empty. The superuser for the specified database. Can use secrets, too + # mysql password: ${{ secrets.DatabasePassword }} # Required if "mysql user" exists. The password for the "mysql user" - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 @@ -33,17 +44,6 @@ jobs: run: | npm install npm run serve & - - uses: mirromutth/mysql-action@v1.1 - with: - host port: 3800 # Optional, default value is 3306. The port of host - container port: 3307 # Optional, default value is 3306. The port of container - character set server: 'utf8' # Optional, default value is 'utf8mb4'. The '--character-set-server' option for mysqld - collation server: 'utf8_general_ci' # Optional, default value is 'utf8mb4_general_ci'. The '--collation-server' option for mysqld - mysql version: '8.0' # Optional, default value is "latest". The version of the MySQL - mysql database: 'library' # Optional, default value is "test". The specified database which will be create - mysql root password: ${{ secrets.DB_PASS }} # Required if "mysql user" is empty, default is empty. The root superuser password - # mysql user: 'developer' # Required if "mysql root password" is empty, default is empty. The superuser for the specified database. Can use secrets, too - # mysql password: ${{ secrets.DatabasePassword }} # Required if "mysql user" exists. The password for the "mysql user" # - run: npm ci # - run: npm run build --if-present # - run: npm test