insinfo is testing Dart #36
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
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Dart | |
run-name: ${{ github.actor }} is testing Dart | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
#env: | |
#DB_HOST: localhost | |
#DB_USERNAME: sisadmin | |
#DB_PASSWORD: s1sadm1n | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
os: [ubuntu-22.04] | |
sdk: [3.2.1] | |
# services: | |
# mysql: | |
# image: mysql:8 | |
# env: | |
# #MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
# MYSQL_ROOT_PASSWORD: dart | |
# MYSQL_DATABASE: banco_teste | |
# MYSQL_USER: dart | |
# MYSQL_PASSWORD: dart | |
# ports: | |
# - 3306:3306 | |
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
#services: | |
#postgres: | |
#image: postgres:11 | |
#env: | |
#POSTGRES_DB: banco_teste | |
#POSTGRES_PASSWORD: sisadmin | |
#POSTGRES_USER: s1sadm1n | |
#ports: | |
#- 5432:5432 | |
# Set health checks to wait until postgres has started | |
#options: >- | |
# --health-cmd pg_isready | |
#--health-interval 10s | |
#--health-timeout 5s | |
# --health-retries 5 | |
# sudo cp ci/pg_hba.conf /etc/postgresql/9.6/main/pg_hba.conf | |
steps: | |
#- name: Start mariadb on Ubuntu | |
- uses: ankane/setup-mariadb@v1 | |
with: | |
mariadb-version: "10.11" | |
database: banco_teste | |
- name: get mysql version | |
run: | | |
mysql --version | |
mysql -e 'SELECT VERSION()' -u root | |
- name: SELECT CURRENT_USER | |
run: mysql -e 'SELECT CURRENT_USER()' -u root | |
- name: SELECT DATABASE | |
run: mysql -e 'SELECT DATABASE()' -u root | |
- name: SHOW VARIABLES | |
run: mysql -e "SHOW VARIABLES LIKE 'socket'" | |
# - name: create db mysql | |
# run: mysqladmin create banco_teste | |
- name: SELECT db | |
run: mysql -D banco_teste -e 'SELECT DATABASE()' | |
- name: crete super user | |
run: mysql -e "CREATE USER 'dart'@'%' IDENTIFIED BY 'dart';" -u root | |
- name: GRANT ALL PRIVILEGES | |
run: mysql -e "GRANT ALL PRIVILEGES ON *.* to 'dart'@'%' WITH GRANT OPTION;" -u root | |
- name: FLUSH PRIVILEGES; | |
run: mysql -e "FLUSH PRIVILEGES;" -u root | |
- name: Start PostgreSQL on Ubuntu | |
run: | | |
sudo lsb_release -a | |
sudo systemctl start postgresql.service | |
pg_isready | |
- name: Create additional user | |
run: | | |
sudo -u postgres psql --version | |
sudo -u postgres psql -t -P format=unaligned -c 'show hba_file'; | |
sudo -u postgres psql --command="SELECT * FROM pg_hba_file_rules();" | |
sudo -u postgres psql --command="SHOW password_encryption;" | |
sudo -u postgres psql --command="CREATE ROLE sisadmin WITH LOGIN SUPERUSER PASSWORD 's1sadm1n'" --command="\du" | |
sudo -u postgres psql --command="SET password_encryption = 'md5';" --command="CREATE ROLE usermd5 WITH LOGIN SUPERUSER PASSWORD 's1sadm1n'" --command="\du" | |
sudo -u postgres psql --command="SET password_encryption = 'scram-sha-256';" --command="CREATE ROLE userscram WITH LOGIN SUPERUSER PASSWORD 's1sadm1n'" --command="\du" | |
sudo -u postgres psql --command="SELECT rolname,rolpassword FROM pg_authid" | |
- name: Create additional database | |
run: | | |
sudo -u postgres createdb banco_teste --owner=sisadmin | |
sudo -u postgres createdb sistemas --owner=sisadmin | |
PGPASSWORD=s1sadm1n | |
- uses: actions/checkout@v2 | |
- name: Copy pg_hba | |
run: | | |
sudo ls | |
sudo cp ci/pg_hba.conf /etc/postgresql/14/main/pg_hba.conf | |
sudo systemctl restart postgresql.service | |
pg_isready | |
- uses: dart-lang/[email protected] | |
with: | |
sdk: ${{ matrix.sdk }} | |
- name: Install dependencies | |
run: dart pub get | |
- name: Run tests | |
run: dart run test --concurrency 1 --chain-stack-traces --platform vm |