Merge branch 'main' of https://github.com/last9/openapm-nodejs into i… #267
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: 🏗️ Build @last9/openapm | |
on: | |
push: | |
branches: | |
- '*' | |
jobs: | |
release: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 18.19.0 | |
- uses: shogo82148/actions-setup-mysql@v1.23.0 | |
with: | |
mysql-version: '8.0' | |
- name: Test MySQL Connection | |
run: mysql -h localhost -u root -e 'SELECT version()' | |
- name: Create test DB | |
run: mysql -h localhost -u root -e 'CREATE DATABASE test_db' | |
- name: 🛎 Checkout | |
uses: actions/checkout@v3 | |
- name: 🧶 Get NPM cache | |
uses: actions/cache@v3 | |
id: cache-npm | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ | |
hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: 📦 Install dependencies | |
run: npm install --frozen-lockfile | |
- name: 📦 Install Playwright Deps | |
run: npx playwright install --with-deps | |
- name: 🧪 Test | |
env: | |
DB_HOST: localhost | |
DB_PORT: 3306 | |
DB_NAME: test_db | |
DB_USER: root | |
CI: true | |
run: npm run test | |
- name: 👷 Build | |
run: npm run build |