ci: use fluentci service for mariadb #45
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
# Do not edit this file directly. It is generated by https://deno.land/x/fluent_github_actions | |
name: Example | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Shutdown Ubuntu MySQL (SUDO) | |
run: | | |
sudo service mysql stop | |
sudo apt-get remove --purge mysql-server mysql-client mysql-common -y | |
sudo apt-get autoremove -y | |
sudo apt-get autoclean | |
sudo rm -rf /etc/mysql | |
sudo rm -rf /var/lib/mysql | |
- name: Setup Fluent CI CLI | |
uses: fluentci-io/setup-fluentci@v5 | |
with: | |
wasm: true | |
plugin: mariadb | |
args: | | |
start | |
working-directory: example | |
- name: create todo database | |
run: | | |
flox activate -- mysql -u root --socket=../../mysql/mysql.socket -e "CREATE DATABASE todo;" | |
flox activate -- mysql -u root --socket=../../mysql/mysql.socket -e "CREATE USER 'user'@'localhost' IDENTIFIED BY 'testrootpass';" | |
flox activate -- mysql -u root --socket=../../mysql/mysql.socket -e "GRANT ALL PRIVILEGES ON todo.* TO 'user'@'localhost';" | |
flox activate -- mysql -u root --socket=../../mysql/mysql.socket -e "FLUSH PRIVILEGES;" | |
working-directory: example/.fluentci/mariadb | |
- name: Run tests | |
run: | | |
fluentci run --wasm . test | |
env: | |
MARIADB_DATABASE: todo | |
MARIADB_USER: user | |
MARIADB_PASSWORD: testrootpass | |
MARIADB_ROOT_PASSWORD: root | |
MARIADB_HOST: 127.0.0.1 | |
working-directory: example | |
- name: Run Dagger Pipelines | |
run: dagger run deno run -A ../src/runner.ts | |
working-directory: example |