Skip to content

Commit

Permalink
Fix GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Askaholic committed Dec 28, 2020
1 parent 28117f8 commit a54330c
Showing 1 changed file with 48 additions and 17 deletions.
65 changes: 48 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ env:
FAF_DB_VERSION: v106

jobs:
static-analysis:
# Static Analysis
isort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -17,17 +18,45 @@ jobs:
with:
python-version: 3.7

- name: Install dependencies with pipenv
run: |
pip install pipenv
pipenv sync --dev
pipenv install --dev isort flake8
- name: Install dependencies
run: pip install isort

- run: isort . --check --diff

flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.7

- run: pipenv run isort --recursive --diff
- run: pipenv run flake8
- name: Install dependencies
run: pip install flake8

- run: flake8

# Tests
unit-test:
runs-on: ubuntu-latest
services:
faf-db:
image: mysql:5.7
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping --silent"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
MYSQL_ROOT_PASSWORD: banana
MYSQL_DATABASE: faf
MYSQL_USER: faf-python-server
MYSQL_PASSWORD: banana

steps:
- uses: actions/checkout@v2

Expand All @@ -36,14 +65,17 @@ jobs:
with:
python-version: 3.7

- name: Setup Database
- name: Run flyway db migrations
env:
FLYWAY_URL: jdbc:mysql://localhost/faf?useSSL=false
FLYWAY_USER: root
FLYWAY_PASSWORD: banana
FLYWAY_LOCATIONS: filesystem:db/migrations
run: |
git clone https://github.com/FAForever/db.git faf-db
&& pushd faf-db
&& git checkout ${FAF_DB_VERSION}
&& ./ci/bootstrap.sh
&& popd
docker exec -i faf-db mysql -uroot -pbanana faf -e "select * from login;"
git clone --depth 1 --branch ${FAF_DB_VERSION} https://github.com/FAForever/db
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
netstat -tulpan
flyway-6.5.3/flyway migrate
- name: Install dependencies with pipenv
run: |
Expand All @@ -64,6 +96,5 @@ jobs:

- name: Test image
run: |
docker run --rm -d --name test_container -p 8000:8000 test_image
docker run --link test_container:test_container waisbrot/wait
docker run --rm -d -p 8001:8001 test_image
nc -z localhost 8001

0 comments on commit a54330c

Please sign in to comment.