Node.js CI and Playwright Tests #70
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 and Playwright Tests' | |
on: | |
workflow_dispatch: | |
schedule: | |
# Test 3 times a day | |
- cron: '0 */8 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
node-version: ['14.21.3'] | |
steps: | |
# Downloads a copy of the code in your repository before running CI tests | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Start MySQL service | |
run: | | |
sudo systemctl start mysql.service | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: Install dependencies of back-end and start building and running | |
working-directory: source/back-end | |
run: | | |
npm install | |
npm run start & | |
- name: Install dependencies of front-end and start building and running | |
working-directory: source/front-end | |
run: | | |
npm install | |
npm run serve & | |
- name: Ensure browsers are installed | |
run: playwright install --with-deps | |
- name: Run all tests | |
run: | | |
pytest --tracing on | |
- name: Upload trace files as artifact | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: playwright-trace | |
path: test-results/ |