Disable annoying teardown messages from Jest #59
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
# Runs all test cases using Jest for each commit this point forwards | |
name: Run Tests | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
# Oddly, the way GitHub Actions runs code results in the template .env files not being found | |
env: | |
ALLOW_TESTING_ON_PROD: true | |
SKIP_TEARDOWN: true | |
MYSQL_HOST: localhost | |
MYSQL_USER: mysql | |
MYSQL_PASSWORD: password | |
MYSQL_DATABASE: testing | |
# services: | |
# mysql: | |
# image: mysql:8 | |
# env: | |
# MYSQL_DATABASE: testing | |
# MYSQL_USER: mysql | |
# MYSQL_PASSWORD: password | |
# MYSQL_ROOT_PASSWORD: password | |
# ports: | |
# - 3306:3306 | |
# # An unfortunate way to run a command within the container | |
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: npm | |
# Uncomment and use the service instead when support is added for non-legacy login (turn off default-authentication-plugin=mysql_native_password) | |
- name: Install and set up MySQL v8.0 | |
run: | | |
sudo apt install mysql-server | |
echo "Starting MySQL" | |
sudo systemctl start mysql.service | |
echo "Creating Database" | |
sudo mysql -proot -e "CREATE DATABASE testing;" | |
echo "Creating User" | |
sudo mysql -proot -e "CREATE USER mysql@localhost IDENTIFIED WITH mysql_native_password BY 'password';" | |
echo "Granting permissions" | |
sudo mysql -proot -e "GRANT ALL PRIVILEGES ON testing.* TO 'mysql'@'localhost';" | |
sudo mysql -proot -e "FLUSH PRIVILEGES;" | |
- name: Install Dependencies | |
run: npm ci | |
- name: Run Tests | |
run: npm run ci-tests |