Skip to content

Commit f57d239

Browse files
authored
Remove travis add github actions (#3)
* trying different linter * update github actions trigger * update github actions * test lint failure * bump lint version * fix typo * setup mysql in githubactions * fix yml * update SQL validation to looks like travis * update user and pass * try remove password * try pass * fix: ports * fix: ports * fix SQL error * remove travis file * add concurrency flag * simplifying
1 parent f171ea7 commit f57d239

File tree

2 files changed

+26
-27
lines changed

2 files changed

+26
-27
lines changed

.github/workflows/validations.yml

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,40 @@ name: Validations
22

33
on:
44
push:
5-
branches: [ $default-branch ]
65
pull_request:
7-
branches: [ $default-branch ]
8-
96
workflow_dispatch:
107

8+
concurrency:
9+
group: ${{ github.head_ref || github.ref_name }}
10+
cancel-in-progress: true
11+
1112
jobs:
1213
build:
1314
runs-on: ubuntu-latest
14-
name: SQL Lint
15+
name: SQL Validations
16+
17+
env:
18+
DB_DATABASE: cideades_e_estados
19+
DB_USER: root
20+
DB_PASSWORD: rootpassword
21+
22+
services:
23+
mysql:
24+
image: mysql:5.7
25+
env:
26+
MYSQL_DATABASE: ${{env.DB_DATABASE}}
27+
MYSQL_ROOT_PASSWORD: ${{ env.DB_PASSWORD }}
28+
ports:
29+
- 3306:3306
30+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
1531

1632
steps:
1733
- uses: actions/checkout@v4
1834

19-
- uses: yu-iskw/action-sqlfluff@v4
20-
id: lint-sql
21-
with:
22-
github_token: ${{ secrets.github_token }}
23-
reporter: github-pr-review
24-
sqlfluff_version: "3.2.5"
25-
sqlfluff_command: "lint"
26-
paths: "${{ github.workspace }}/src"
27-
28-
- name: Run a multi-line script
35+
- name: run SQL with no errors
2936
run: |
30-
echo Add other actions to build,
31-
echo test, and deploy your project.
37+
mysql -h 127.0.0.1 -e 'CREATE DATABASE IF NOT EXISTS ${{env.DB_DATABASE}};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
38+
mysql -h 127.0.0.1 --default-character-set=utf8 ${{env.DB_DATABASE}} < src/cidades-e-estados.sql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
39+
mysql -h 127.0.0.1 -e 'USE ${{env.DB_DATABASE}}; DROP TABLE cidades; DROP TABLE estados;' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
40+
mysql -h 127.0.0.1 --default-character-set=utf8 ${{env.DB_DATABASE}} < src/estados.sql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
41+
mysql -h 127.0.0.1 --default-character-set=utf8 ${{env.DB_DATABASE}} < src/cidades.sql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}

.travis.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)