77 FAF_DB_VERSION : v106
88
99jobs :
10- static-analysis :
10+ # Static Analysis
11+ isort :
1112 runs-on : ubuntu-latest
1213 steps :
1314 - uses : actions/checkout@v2
@@ -17,17 +18,45 @@ jobs:
1718 with :
1819 python-version : 3.7
1920
20- - name : Install dependencies with pipenv
21- run : |
22- pip install pipenv
23- pipenv sync --dev
24- pipenv install --dev isort flake8
21+ - name : Install dependencies
22+ run : pip install isort
23+
24+ - run : isort . --check --diff
25+
26+ flake8 :
27+ runs-on : ubuntu-latest
28+ steps :
29+ - uses : actions/checkout@v2
30+
31+ - name : Setup Python
32+ uses : actions/setup-python@v1
33+ with :
34+ python-version : 3.7
2535
26- - run : pipenv run isort --recursive --diff
27- - run : pipenv run flake8
36+ - name : Install dependencies
37+ run : pip install flake8
2838
39+ - run : flake8
40+
41+ # Tests
2942 unit-test :
3043 runs-on : ubuntu-latest
44+ services :
45+ faf-db :
46+ image : mysql:5.7
47+ ports :
48+ - 3306:3306
49+ options : >-
50+ --health-cmd "mysqladmin ping --silent"
51+ --health-interval 10s
52+ --health-timeout 5s
53+ --health-retries 5
54+ env :
55+ MYSQL_ROOT_PASSWORD : banana
56+ MYSQL_DATABASE : faf
57+ MYSQL_USER : faf-python-server
58+ MYSQL_PASSWORD : banana
59+
3160 steps :
3261 - uses : actions/checkout@v2
3362
@@ -36,14 +65,16 @@ jobs:
3665 with :
3766 python-version : 3.7
3867
39- - name : Setup Database
68+ - name : Run flyway db migrations
69+ env :
70+ FLYWAY_URL : jdbc:mysql://localhost/faf?useSSL=false
71+ FLYWAY_USER : root
72+ FLYWAY_PASSWORD : banana
73+ FLYWAY_LOCATIONS : filesystem:db/migrations
4074 run : |
41- git clone https://github.com/FAForever/db.git faf-db
42- && pushd faf-db
43- && git checkout ${FAF_DB_VERSION}
44- && ./ci/bootstrap.sh
45- && popd
46- docker exec -i faf-db mysql -uroot -pbanana faf -e "select * from login;"
75+ git clone --depth 1 --branch ${FAF_DB_VERSION} https://github.com/FAForever/db
76+ wget -qO- https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/6.5.3/flyway-commandline-6.5.3-linux-x64.tar.gz | tar xz
77+ flyway-6.5.3/flyway migrate
4778
4879 - name : Install dependencies with pipenv
4980 run : |
5283
5384 - run : pipenv run tests
5485 - run : sed -i.bak s#/code/#$(pwd)/#g .coverage
55- - run : coveralls
86+ - name : Report coverage
87+ env :
88+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
89+ run : pipenv run coveralls
5690
5791 docker-build :
5892 runs-on : ubuntu-latest
6498
6599 - name : Test image
66100 run : |
67- docker run --rm -d --name test_container -p 8000:8000 test_image
68- docker run --link test_container:test_container waisbrot/wait
101+ docker run --rm -d -p 8001:8001 test_image
69102 nc -z localhost 8001
0 commit comments