From 2f1873d12009cb6af55d4c9258f5bbd35a60d55f Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Fri, 30 Apr 2021 21:47:21 +0200 Subject: [PATCH 1/5] Add inital GitHub Actions --- .github/dependabot.yml | 6 ++++++ .github/workflows/test.yml | 27 +++++++++++++++++++++++++++ tox.ini | 8 ++++++++ 3 files changed, 41 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/test.yml 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/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..9a5c331f7 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,27 @@ +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 diff --git a/tox.ini b/tox.ini index a391d61c3..002746b1a 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 \ From 95918cda8814aad62efbd99e9aa4f51353d38d03 Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Fri, 30 Apr 2021 23:36:56 +0200 Subject: [PATCH 2/5] Move website generation to GitHub Actions --- .github/deploy.sh | 39 ------------------------------------ .github/deploy_key.enc | Bin 400 -> 0 bytes .github/deploy_key.pub | 1 - .github/website-exclude | 12 ----------- .github/workflows/pages.yml | 31 ++++++++++++++++++++++++++++ .travis.yml | 8 -------- 6 files changed, 31 insertions(+), 60 deletions(-) delete mode 100755 .github/deploy.sh delete mode 100644 .github/deploy_key.enc delete mode 100644 .github/deploy_key.pub delete mode 100644 .github/website-exclude create mode 100644 .github/workflows/pages.yml 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 f7508de395162e326904c8cc73f4bcc9a3ff4844..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 400 zcmV;B0dM{vb?0fV6*SBgHaKq!%4|U<#xA>Ktk^e7*txQGJ%^n6)R5aI+W>$fl8gX6 zZN=G!02??PIgR^}vYp0d-N| zepSIcUrgz|LW6?1$NB;BN!BIm{Ajms&Y)_1I2(CJ2Wh5?vLZkjwkD2N0jTtaVp}d( z6dH=N{--4l#AozOU6jc}Bh|cRb={4xoM%cBaY~~d)Z>wu%F*E+*GqBL;GzHPeB9_q zYsBjc>`GKmfOWpEccLL>>>)4qX*-hAV(O~K9nCSKwFtFQNQ`CO| 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/.travis.yml b/.travis.yml index c089adf22..10c800ba3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,11 +30,3 @@ notifications: - "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 From 50f6288c86614607d2de666962e619ce5a64efe4 Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Sat, 1 May 2021 11:27:05 +0200 Subject: [PATCH 3/5] Move codecov to GitHub Actions --- .github/workflows/test.yml | 4 ++++ .travis.yml | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9a5c331f7..7442f5ede 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,3 +25,7 @@ jobs: - name: Test with tox run: tox + + - uses: codecov/codecov-action@v1 + with: + directory: '.tox/reports' diff --git a/.travis.yml b/.travis.yml index 10c800ba3..001242b79 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,11 +17,10 @@ before_script: - "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 + - pip install -U tox-travis setuptools # 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: From 9588ab4355ed32af407e282f1d6b15321c1636d7 Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Sat, 1 May 2021 13:30:33 +0200 Subject: [PATCH 4/5] Move codeclimate reporter to GitHub Actions --- .github/workflows/test.yml | 12 ++++++++++++ .travis.yml | 8 -------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7442f5ede..f4879b051 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,6 +25,18 @@ jobs: - 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: diff --git a/.travis.yml b/.travis.yml index 001242b79..479f3b985 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,23 +6,15 @@ jobs: - 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 # command to run tests script: tox -after_success: - - "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: From 5dbb5aacb4052916cc0a8ef0b4288d9ff8685a5c Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Sat, 1 May 2021 13:40:43 +0200 Subject: [PATCH 5/5] Remove Travis-CI configuration --- .gitattributes | 2 +- .travis.yml | 23 ----------------------- README.md | 8 ++++---- tox.ini | 4 ---- 4 files changed, 5 insertions(+), 32 deletions(-) delete mode 100644 .travis.yml 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/.travis.yml b/.travis.yml deleted file mode 100644 index 479f3b985..000000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -os: linux -language: python -jobs: - include: - - python: "3.6" - - python: "3.7" - - python: "3.8" - - python: "3.9" -cache: pip -git: - depth: false -dist: xenial -# command to install dependencies -install: - - pip install -U tox-travis setuptools -# command to run tests -script: tox -notifications: - irc: - channels: - - "chat.freenode.net#dosage" - use_notice: true - skip_join: true 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 002746b1a..2c33c5f11 100644 --- a/tox.ini +++ b/tox.ini @@ -22,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