Skip to content

Commit

Permalink
Merge pull request camptocamp#14 from acsone/test-with-gha
Browse files Browse the repository at this point in the history
Test with GitHub actions
  • Loading branch information
sbidoul authored Apr 10, 2022
2 parents 2476841 + 7e85645 commit 30399b4
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 65 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test

on:
push:
branches:
- master
pull_request:

jobs:
test:
runs-on: ubuntu-18.04
strategy:
matrix:
WKHTMLTOPDF_VERSION:
- "0.12.1.3"
- "0.12.5"
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
pip install tox
sudo apt-get -y install -f ghostscript python-requests
# overwrite default imagemagick policy that prevents reading PDF
sudo cp tests/travis-imagemagick-policy.xml /etc/ImageMagick-6/policy.xml
- name: Install kwkhtmltopdf for local tests
run: |
wget -q -O wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
sudo apt -y install -f ./wkhtmltox.deb
- name: Build and start server image
run: |
docker build -f Dockerfile-${{ matrix.WKHTMLTOPDF_VERSION }} -t kwkhtmltopdf:${{ matrix.WKHTMLTOPDF_VERSION }} .
docker run -d --name kwkhtmltopdf -p 8080:8080 kwkhtmltopdf:${{ matrix.WKHTMLTOPDF_VERSION }}
- name: Run tests
run: KWKHTMLTOPDF_SERVER_URL=http://localhost:8080 WKHTMLTOPDF_VERSION=${{ matrix.WKHTMLTOPDF_VERSION }} tox
61 changes: 0 additions & 61 deletions .travis.yml

This file was deleted.

7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,10 @@ as well as some TODO's in the source code.

Push the master branch and ensure tests pass on travis.

Create and push a git tag.
Build the go client and server as explained above. Create and tag a release on GitHub
and attach the client and server you just built to it.

Travis will create a GitHub release with the client and server binaries.

Images are built and push to ghcr.io by a GitHub action.
Images are built and pushed to ghcr.io by a GitHub action.

## Credits

Expand Down
Binary file modified tests/data/test1-0.12.1.3.pdf
Binary file not shown.
Binary file modified tests/data/test2-0.12.1.3.pdf
Binary file not shown.
Binary file modified tests/data/test3-0.12.1.3.pdf
Binary file not shown.
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ skip_missing_interpreters = True
[testenv]
deps =
-r{toxinidir}/tests/requirements.txt.in
; home is necessary for go to obtain its cache directory
passenv =
KWKHTMLTOPDF_SERVER_URL
KWKHTMLTOPDF_BIN
HOME
commands =
pytest -v tests {posargs}

Expand Down

0 comments on commit 30399b4

Please sign in to comment.