diff --git a/.gitattributes b/.gitattributes index 3f5df5b50..e84d38dad 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,3 @@ .gitattributes export-ignore .gitignore export-ignore -.travis.yml export-ignore +.github export-ignore diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..123014908 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/deploy.sh b/.github/deploy.sh deleted file mode 100755 index 5b9be9885..000000000 --- a/.github/deploy.sh +++ /dev/null @@ -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 - diff --git a/.github/deploy_key.enc b/.github/deploy_key.enc deleted file mode 100644 index f7508de39..000000000 Binary files a/.github/deploy_key.enc and /dev/null differ diff --git a/.github/deploy_key.pub b/.github/deploy_key.pub deleted file mode 100644 index 90dd5482c..000000000 --- a/.github/deploy_key.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG/I1J2fVYFzxQP7cZK32kI28cv94NH0xdq08OoIfwpz website-autodeploy diff --git a/.github/website-exclude b/.github/website-exclude deleted file mode 100644 index 79e9639b4..000000000 --- a/.github/website-exclude +++ /dev/null @@ -1,12 +0,0 @@ -CNAME -Jenkinsfile -build -cc-test-reporter -coverage -dist -dosage -dosagelib -scripts -setup.cfg -setup.py -tests diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 000000000..2c95031c5 --- /dev/null +++ b/.github/workflows/pages.yml @@ -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' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..f4879b051 --- /dev/null +++ b/.github/workflows/test.yml @@ -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' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c089adf22..000000000 --- a/.travis.yml +++ /dev/null @@ -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 diff --git a/README.md b/README.md index a1c2d1eb2..9d3267dfe 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/tox.ini b/tox.ini index a391d61c3..2c33c5f11 100644 --- a/tox.ini +++ b/tox.ini @@ -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