Skip to content

Commit

Permalink
Migrate from travis-ci to github actions
Browse files Browse the repository at this point in the history
since Travis can't handle anymore open source projects anymore.
  • Loading branch information
bansan85 committed Nov 21, 2020
1 parent eb1e640 commit 091cf15
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 130 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/documentation-generation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: documentation

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY_TRAVIS_CI }}
# get with ssh-keyscan localhost
known_hosts: localhost ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCUWdBcM5OvIS/hYfBQkC6nKSuyoPfuYrc90aiTYZvNkKIVKDcTWHmgPJMllbP4GD8b5lBF1NPGde2iKO0d0K/7IIAI0/nAKYgKcu0b1JuF9m4lj7x8YWSGFSXg+EmU3IUBLr777jbok9mCLy1UO6I6Dmu/nNwy+Q8GCAbqtQodUF1fpavJeTIBnVBcGOkesUC/X1HIboCiBQl1etUj8Xip3eb41TVz7Eda2DUSEsot4g4SkYd6fnCve4c2hO2vGzeeMsdWOWaM/FZCBy6FBCYC15ta8dcAOBzkqM9/kPDxuR53qzjHoZhwLu4XWybd5J+4gmKlPkwQDSUwvCsVx5ax
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Install dependencies
run: bundle install
- name: Publish documentation
run: |
eval `ssh-agent`
ssh-add ~/.ssh/id_rsa
git clone --depth 1 ssh://git@github.com/bansan85/ocr-book-travis.git -b documentation
rm -Rf ocr-book-travis/{*.htm*,*.png}
cd doc
find . -name "*.asciidoc" -exec asciidoctor {} -D ../ocr-book-travis \;
cp *.png ../ocr-book-travis/
cd ..
cd ocr-book-travis
git config --global user.name "Travis"
git config --global user.email "travis-ci@le-garrec.fr"
git add .
if [ -n "$(git diff-index --name-only HEAD --)" ]; \
then \
git commit -m "${{ github.event.head_commit.message }}" -m "Update from $GITHUB_SHA"; \
git push || { echo "Failure git push" && exit 1; } \
fi
cd ..
66 changes: 66 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: pytest

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY_TRAVIS_CI }}
# get with ssh-keyscan localhost
known_hosts: localhost ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCUWdBcM5OvIS/hYfBQkC6nKSuyoPfuYrc90aiTYZvNkKIVKDcTWHmgPJMllbP4GD8b5lBF1NPGde2iKO0d0K/7IIAI0/nAKYgKcu0b1JuF9m4lj7x8YWSGFSXg+EmU3IUBLr777jbok9mCLy1UO6I6Dmu/nNwy+Q8GCAbqtQodUF1fpavJeTIBnVBcGOkesUC/X1HIboCiBQl1etUj8Xip3eb41TVz7Eda2DUSEsot4g4SkYd6fnCve4c2hO2vGzeeMsdWOWaM/FZCBy6FBCYC15ta8dcAOBzkqM9/kPDxuR53qzjHoZhwLu4XWybd5J+4gmKlPkwQDSUwvCsVx5ax
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r test-requirements.txt
- name: Lint
run: |
pylint {**,.}/*.py
flake8 {**,.}/*.py
prospector {**,.}/*.py
pycodestyle {**,.}/*.py
mypy {**,.}/*.py
- name: Test with pytest
run: |
pytest --no-cov-on-fail
sed -i "s/^.*created at.*$//" cov_html/*.html
- name: Publish results
run: |
eval `ssh-agent`
ssh-add ~/.ssh/id_rsa
git clone --depth 1 ssh://git@github.com/bansan85/ocr-book-travis.git -b "unittest""${{ matrix.python-version }}"
rm -Rf ocr-book-travis/*
cp -R pytest-junit.xml cov_html coverage.xml ocr-book-travis/
cd ocr-book-travis
git config --global user.name "Travis"
git config --global user.email "travis-ci@le-garrec.fr"
git add .
if [ -n "$(git diff-index --name-only HEAD --)" ]; \
then \
git commit -m "${{ github.event.head_commit.message }}" -m "Update from $GITHUB_SHA"; \
git push || { echo "Failure git push" && exit 1; } \
fi
cd ..
53 changes: 0 additions & 53 deletions .travis.yml

This file was deleted.

30 changes: 0 additions & 30 deletions travis/generate-doc.sh

This file was deleted.

Binary file removed travis/private-travis-ci-le-garrec.fr.key.enc
Binary file not shown.
13 changes: 0 additions & 13 deletions travis/register_ssh_key.sh

This file was deleted.

34 changes: 0 additions & 34 deletions travis/run-tests.sh

This file was deleted.

0 comments on commit 091cf15

Please sign in to comment.