chore: update modules #2453
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Node.js CI | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 10 * * *' | |
jobs: | |
test: | |
name: 'Test on Node:${{ matrix.node-version }} OS:ubuntu-latest' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18, 20] | |
services: | |
postgres: | |
image: postgres | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_PASSWORD: postgres | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
env: | |
TEST_PG_PORT: 5432 | |
TEST_PG_PASSWORD: postgres | |
TEST_MYSQL_PORT: 3306 | |
TEST_MYSQL_USER: root | |
TEST_MYSQL_PASSWORD: root | |
steps: | |
- uses: actions/checkout@v3 | |
- name: setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- uses: actions/cache@v2 | |
id: npm-cache | |
with: | |
path: "node_modules" | |
key: ${{ runner.os }}-node-v${{ matrix.node-version }}-npm-${{ hashFiles('package-lock.json') }} | |
- run: npm install | |
if: steps.npm-cache.outputs.cache-hit != 'true' | |
- run: npm run lint | |
- run: npm run build | |
- run: npm run typecheck | |
- run: sudo systemctl start mysql.service | |
- run: npm test | |
env: | |
TEST_CFA_RANDOM_NUM: 1 | |
TEST_CFA_FIX_DB: postgresql | |
TEST_CFA_FIX_ORM: prisma | |
- run: npm test | |
env: | |
TEST_CFA_RANDOM_NUM: 1 | |
TEST_CFA_FIX_DB: mysql | |
TEST_CFA_FIX_ORM: typeorm | |
- run: npm test | |
env: | |
TEST_CFA_RANDOM_NUM: 1 | |
TEST_CFA_FIX_DB: sqlite | |
- run: npm test | |
if: github.event_name == 'schedule' | |
env: | |
TEST_CFA_RANDOM_NUM: 5 | |
# - uses: mxschmitt/action-tmate@v3 | |
# if: ${{ failure() }} | |
test-win: | |
name: 'Test on Node:${{ matrix.node-version }} OS:windows-latest' | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
node-version: [18] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- uses: actions/cache@v2 | |
id: npm-cache | |
with: | |
path: "node_modules" | |
key: ${{ runner.os }}-node-v${{ matrix.node-version }}-npm-${{ hashFiles('package-lock.json') }} | |
- run: echo 'fetch-timeout=1000000' >> ~/.npmrc | |
- run: npm install | |
if: steps.npm-cache.outputs.cache-hit != 'true' | |
- run: npm run build | |
- run: npm run typecheck | |
- run: npm test | |
env: | |
TEST_CFA_RANDOM_NUM: 1 | |
TEST_CFA_FIX_DB: sqlite | |
- run: npm test | |
if: github.event_name == 'schedule' | |
env: | |
TEST_CFA_RANDOM_NUM: 5 | |
TEST_CFA_FIX_DB: sqlite | |
release: | |
runs-on: ubuntu-latest | |
needs: [test, test-win] | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
registry-url: 'https://registry.npmjs.org' | |
- uses: actions/cache@v2 | |
id: npm-cache | |
with: | |
path: 'node_modules' | |
key: ${{ runner.os }}-node-v18-npm-${{ hashFiles('package-lock.json') }} | |
- run: echo 'fetch-timeout=1000000' >> ~/.npmrc | |
- run: npm install | |
if: steps.npm-cache.outputs.cache-hit != 'true' | |
- run: npm run build | |
- run: | | |
VERSION="$(node -e 'console.log(process.argv[1].match(/^refs\/tags\/v(\d+\.\d+\.\d+)$/)[1])' "${{ github.ref }}")" | |
node -e 'console.log(JSON.stringify({...require("./package.json"),version:process.argv[1]}, null, 2))' "$VERSION" | tee ./tmp-package.json | |
mv ./tmp-package.json ./package.json | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |