-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #171 from HackSoc/github-actions
Switch to GitHub Action & GitHub Packages, test on more Python versions
- Loading branch information
Showing
10 changed files
with
79 additions
and
56 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 |
---|---|---|
@@ -1,17 +1,71 @@ | ||
name: CI | ||
|
||
on: [push] | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
build: | ||
tests: | ||
runs-on: ubuntu-18.04 | ||
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8, 3.9] | ||
include: | ||
- python-version: 3.6 | ||
toxenv: py36 | ||
- python-version: 3.7 | ||
toxenv: py37 | ||
- python-version: 3.8 | ||
toxenv: py38 | ||
- python-version: 3.9 | ||
toxenv: py39-flake8 | ||
env: | ||
PYTHON: ${{ matrix.python-version }} | ||
steps: | ||
- name: examine environment | ||
run: env | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install tox | ||
- name: Test with tox | ||
run: python -m tox | ||
env: | ||
TOXENV: ${{ matrix.toxenv }} | ||
- uses: codecov/codecov-action@v1 | ||
with: | ||
env_vars: PYTHON | ||
|
||
docker: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Run a one-line script | ||
run: echo Hello, world! | ||
- name: Run a multi-line script | ||
run: | | ||
echo Add other actions to build, | ||
echo test, and deploy your project. | ||
- name: Build Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
load: true | ||
push: false | ||
tags: csbot:latest | ||
- name: Run tests inside Docker | ||
run: docker run --rm csbot:latest pytest | ||
- name: Login to GitHub Packages | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: docker.pkg.github.com | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Publish Docker image | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
tags: | | ||
docker.pkg.github.com/hacksoc/csbot/csbot:latest |
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 |
---|---|---|
|
@@ -42,6 +42,7 @@ pip-log.txt | |
|
||
# Unit test / coverage reports | ||
.coverage | ||
coverage*.xml | ||
.tox | ||
nosetests.xml | ||
_trial_temp/ | ||
|
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[pytest] | ||
testpaths = tests/ | ||
addopts = --cov=src/ -W ignore::schematics.deprecated.SchematicsDeprecationWarning | ||
addopts = --cov=src/ --cov-report=xml -W ignore::schematics.deprecated.SchematicsDeprecationWarning | ||
markers = | ||
bot: mark a test as Bot-based rather than IRCClient-based |
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
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 |
---|---|---|
@@ -1,15 +1,12 @@ | ||
[tox] | ||
envlist = py36,py37 | ||
envlist = py36,py37,py38,py39-flake8 | ||
skipsdist = True | ||
|
||
[testenv] | ||
passenv = TRAVIS TRAVIS_* | ||
passenv = TRAVIS TRAVIS_* GITHUB_* | ||
deps = | ||
-r requirements.txt | ||
coveralls: coveralls | ||
flake8: flake8 | ||
commands = | ||
python -m pytest {posargs} | ||
flake8: flake8 --exit-zero --exclude=src/csbot/plugins_broken src/ tests/ | ||
# Try to run coveralls, but don't fail if coveralls fails | ||
coveralls: - coveralls |