This repository has been archived by the owner on May 7, 2024. It is now read-only.
Merge pull request #70 from NavigoLearn/feature-databasemigrations #340
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: Run Tests | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
token: ${{ secrets.PAT }} | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '18.x' | |
- name: Set up env | |
run: | | |
while read -r line; do | |
key=$(echo $line | cut -d= -f1) | |
value=$(echo $line | cut -d= -f2-) | |
echo "::add-mask::$value" | |
echo "$key=$value" >> $GITHUB_ENV | |
done < <(grep -o '^[^#]*' ./env/test.env) | |
- name: Shutdown Ubuntu MySQL (SUDO) | |
run: sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it | |
- name: Setup MariaDB | |
uses: ankane/setup-mariadb@v1 | |
with: | |
mariadb-version: 10.11 | |
- name: Setup MariaDB environment | |
run: | | |
sudo mysql -u root -e "CREATE DATABASE $MARIADB_DATABASE;" | |
sudo mysql -u root -e "CREATE USER '$MARIADB_USERNAME'@'localhost' IDENTIFIED BY '$MARIADB_PASSWORD';" | |
sudo mysql -u root -e "GRANT ALL PRIVILEGES ON $MARIADB_DATABASE.* TO '$MARIADB_USERNAME'@'localhost';" | |
- name: Install dependencies | |
run: npm install | |
- name: Run tests | |
run: npm run test:no-reloading |