Merge pull request #187 from webcomics/gh-actions

Switch from Travis-CI to GitHub Actions
This commit is contained in:
Tobias Gruetzmacher 2021-05-01 13:58:32 +02:00 committed by GitHub
commit 63bc637ae7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 93 additions and 101 deletions

2
.gitattributes vendored
View file

@ -1,3 +1,3 @@
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
.github export-ignore

6
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

39
.github/deploy.sh vendored
View file

@ -1,39 +0,0 @@
#!/bin/sh
set -e
P="$(mktemp -d)"
mkdir "$P/git" "$P/out"
if [ "$encrypted_1671ba5f199a_key" ]
then
eval "$(ssh-agent -s)"
openssl aes-256-cbc -K "$encrypted_1671ba5f199a_key" \
-iv "$encrypted_1671ba5f199a_iv" \
-in .github/deploy_key.enc -out .github/deploy_key -d
chmod 600 .github/deploy_key
ssh-add .github/deploy_key
pip install git+https://github.com/spanezz/staticsite.git@v1.2
fi
git clone --depth=10 --branch=gh-pages "git@github.com:${TRAVIS_REPO_SLUG}.git" "$P/git"
rm -Rfv dosage.egg-info
ssite build --output "$P/out"
rsync -r --del --verbose --cvs-exclude --exclude-from .github/website-exclude \
"$P/out/" "$P/git"
cd "$P/git"
git config user.email 'nobody@23.gs'
git config user.name 'Travis-CI Website Bot'
git config push.default simple
git add -A .
if [ "$TRAVIS_COMMIT" ]
then
git commit -a -m "Update website from commit $TRAVIS_COMMIT" || true
git push origin HEAD:gh-pages
fi

BIN
.github/deploy_key.enc vendored

Binary file not shown.

View file

@ -1 +0,0 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG/I1J2fVYFzxQP7cZK32kI28cv94NH0xdq08OoIfwpz website-autodeploy

View file

@ -1,12 +0,0 @@
CNAME
Jenkinsfile
build
cc-test-reporter
coverage
dist
dosage
dosagelib
scripts
setup.cfg
setup.py
tests

31
.github/workflows/pages.yml vendored Normal file
View file

@ -0,0 +1,31 @@
name: GitHub Pages
on:
- push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 10
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Build
run: |
pip install git+https://github.com/spanezz/staticsite.git@v1.2
ssite build --output public
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
cname: dosage.rocks
github_token: ${{ secrets.GITHUB_TOKEN }}
exclude_assets: 'Jenkinsfile,dosagelib,scripts,setup.*,tests,*.ini'

43
.github/workflows/test.yml vendored Normal file
View file

@ -0,0 +1,43 @@
name: Tests (tox)
on:
- push
- pull_request
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install tox tox-gh-actions
- name: Test with tox
run: tox
if: ${{ matrix.python-version != '3.9' }}
- name: Test with tox (and upload coverage)
uses: paambaati/codeclimate-action@v2.7.5
if: ${{ matrix.python-version == '3.9' }}
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: tox
coverageLocations: |
${{ github.workspace }}/.tox/reports/*/coverage.xml:coverage.py
prefix: ${{ github.workspace }}/.tox/py39/lib/python3.9/site-packages
- uses: codecov/codecov-action@v1
with:
directory: '.tox/reports'

View file

@ -1,40 +0,0 @@
os: linux
language: python
jobs:
include:
- python: "3.6"
- python: "3.7"
- python: "3.8"
- python: "3.9"
env: "CC_TEST_REPORTER_ID=2a411f596959fc32f5d73f3ba7cef8cc4d5733299d742dbfc97fd6c190b9010c"
cache: pip
git:
depth: false
dist: xenial
before_script:
- "curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > cc-test-reporter"
- "chmod +x cc-test-reporter"
- "if [ -n \"$CC_TEST_REPORTER_ID\" ]; then ./cc-test-reporter before-build; fi"
# command to install dependencies
install:
- pip install -U tox-travis setuptools codecov
# command to run tests
script: tox
after_success:
- codecov --file .tox/reports/*/coverage.xml
- "if [ -n \"$CC_TEST_REPORTER_ID\" ]; then ./cc-test-reporter format-coverage --prefix $PWD/.tox/*/lib/*/site-packages --input-type coverage.py .tox/cov-*.xml; fi"
- "if [ -n \"$CC_TEST_REPORTER_ID\" ]; then ./cc-test-reporter upload-coverage; fi"
notifications:
irc:
channels:
- "chat.freenode.net#dosage"
use_notice: true
skip_join: true
# Push site to gh-pages branch
deploy:
- provider: script
skip_cleanup: true
script: .github/deploy.sh
on:
branch: master
python: 3.9

View file

@ -1,6 +1,6 @@
# Dosage
[![Build Status](https://travis-ci.com/webcomics/dosage.svg?branch=master)](https://travis-ci.com/webcomics/dosage)
[![Tests](https://github.com/webcomics/dosage/actions/workflows/test.yml/badge.svg)](https://github.com/webcomics/dosage/actions/workflows/test.yml)
[![Code Climate](https://codeclimate.com/github/webcomics/dosage/badges/gpa.svg)](https://codeclimate.com/github/webcomics/dosage)
[![codecov](https://codecov.io/gh/webcomics/dosage/branch/master/graph/badge.svg)](https://codecov.io/gh/webcomics/dosage)
![Maintenance](https://img.shields.io/maintenance/yes/2021.svg)
@ -128,6 +128,6 @@ existing module classes for examples.
### Test suite status
Dosage has extensive unit tests to ensure the code quality.
[Travis-CI](https://travis-ci.org/) is used for continuous build and test
integration. See the badges at the top of this page for the current status.
Dosage has unit tests to ensure code quality. GitHub Actions are used for
continuous build and test integration. See the badges at the top of this page
for the current status.

12
tox.ini
View file

@ -1,6 +1,14 @@
[tox]
envlist = py36, py37, py38, py39, flake8
[gh-actions]
python =
3.5: py35
3.6: py36
3.7: py37
3.8: py38
3.9: py39, flak8
[testenv]
commands =
{envbindir}/py.test --tb=short \
@ -14,10 +22,6 @@ commands =
--cov-report=html:{toxworkdir}/reports/{envname}/htmlcov \
{posargs}
passenv = CI TRAVIS TRAVIS_*
deps =
pytest-travis-fold
# Also install extra dependencies for tests.
extras =
css