-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from Travis CI to GitHub Actions
Travis has imposed quotas on builds that require us to contact them to obtain OSS credits. The CI tool is irrelevant so long as builds do happen, so switch to GitHub Actions for now. This is a little more complicated that the switch for related projects like git-pw, given the need for a database service. We may wish to investigate reusing some of our own Docker files in the future but for now, this should do the trick. Signed-off-by: Stephen Finucane <stephen@that.guru> (cherry picked from commit 9933a17)
- Loading branch information
1 parent
62b1946
commit 1057b9b
Showing
4 changed files
with
112 additions
and
64 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,104 @@ | ||
--- | ||
name: CI | ||
on: | ||
- push | ||
- pull_request | ||
jobs: | ||
lint: | ||
name: Run linters | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install dependencies | ||
run: python -m pip install tox | ||
- name: Run tox | ||
run: tox -e pep8 | ||
test: | ||
name: Run unit tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python: [3.6, 3.7, 3.8, 3.9] | ||
db: [postgres, mysql] | ||
services: | ||
postgres: | ||
image: postgres:latest | ||
env: | ||
POSTGRES_DB: patchwork | ||
POSTGRES_PASSWORD: patchwork | ||
POSTGRES_USER: patchwork | ||
ports: | ||
- 5432:5432 | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
mysql: | ||
image: mysql:latest | ||
env: | ||
MYSQL_DATABASE: patchwork | ||
MYSQL_USER: patchwork | ||
MYSQL_PASSWORD: patchwork | ||
MYSQL_ROOT_PASSWORD: root | ||
ports: | ||
- 3306:3306 | ||
options: >- | ||
--health-cmd="mysqladmin ping" | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Install Python dependencies | ||
run: python -m pip install tox tox-gh-actions codecov | ||
- name: Log database configuration (mysql) | ||
if: ${{ matrix.db == 'mysql' }} | ||
run: mysql -h 127.0.0.1 -e "SELECT VERSION(), CURRENT_USER();" -uroot -proot patchwork | ||
- name: Log database configuration (postgres) | ||
if: ${{ matrix.db == 'postgres' }} | ||
run: psql -h 127.0.0.1 -c "SELECT VERSION(), CURRENT_USER, current_database()" -U patchwork -d patchwork | ||
env: | ||
PGPASSWORD: patchwork | ||
- name: Modify database user permissions (mysql) | ||
if: ${{ matrix.db == 'mysql' }} | ||
run: mysql -h 127.0.0.1 -e "GRANT ALL ON \`test\\_patchwork%\`.* to 'patchwork'@'%';" -uroot -proot | ||
- name: Run unit tests (via tox) | ||
run: tox | ||
env: | ||
PW_TEST_DB_TYPE: "${{ matrix.db }}" | ||
PW_TEST_DB_USER: "patchwork" | ||
PW_TEST_DB_PASS: "patchwork" | ||
PW_TEST_DB_HOST: "127.0.0.1" | ||
docs: | ||
name: Build docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install dependencies | ||
run: python -m pip install tox | ||
- name: Build docs (via tox) | ||
run: tox -e docs | ||
- name: Archive build results | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: html-docs-build | ||
path: docs/_build/html | ||
retention-days: 7 |
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