-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Migrate to GitHub actions (#695)
* Fix exposed ports * Add flake8 config * Add github actions * Remove travis.yml
- Loading branch information
Showing
5 changed files
with
98 additions
and
46 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Build docker image | ||
name: Build | ||
|
||
on: | ||
release: | ||
types: [published, created, edited] | ||
|
||
jobs: | ||
docker-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build and publish docker image | ||
uses: docker/[email protected] | ||
with: | ||
repository: faforever/faf-python-server | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
build-args: GITHUB_REF=${GITHUB_REF} | ||
tag_with_ref: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Run unit tests | ||
name: Test | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
FAF_DB_VERSION: v106 | ||
|
||
jobs: | ||
static-analysis: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
|
||
- name: Install dependencies with pipenv | ||
run: | | ||
pip install pipenv | ||
pipenv sync --dev | ||
pipenv install --dev isort flake8 | ||
- run: pipenv run isort --recursive --diff | ||
- run: pipenv run flake8 | ||
|
||
unit-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
|
||
- name: Setup Database | ||
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;" | ||
|
||
- name: Install dependencies with pipenv | ||
run: | | ||
pip install pipenv | ||
pipenv sync --dev | ||
- run: pipenv run tests | ||
- run: sed -i.bak s#/code/#$(pwd)/#g .coverage | ||
- run: coveralls | ||
|
||
docker-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build docker image | ||
run: docker build --build-arg GITHUB_REF -t test_image . | ||
|
||
- 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 | ||
nc -z localhost 8001 |
This file was deleted.
Oops, something went wrong.
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 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