Skip to content

Commit 2b5e72f

Browse files
authored
Migrate CI to GitHub Actions (#9)
Migrate CI from travis to GitHub Actions
1 parent 0b197ad commit 2b5e72f

File tree

7 files changed

+79
-17
lines changed

7 files changed

+79
-17
lines changed

.github/scripts/extract_files.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
gpg -q --batch --yes -d --passphrase="$FILES_PASSPHRASE" \
4+
-o tests/files.tar tests/files.enc
5+
tar xf tests/files.tar -C tests/

.github/workflows/pypi-publish.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
deploy:
9+
environment: pypi
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up Python
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: '3.8'
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install setuptools wheel twine
22+
- name: Build and publish
23+
env:
24+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
25+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
26+
run: |
27+
python setup.py sdist bdist_wheel
28+
twine upload dist/*

.github/workflows/run-pytest.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: run-tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ['3.8']
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Extract test files
23+
run: ./.github/scripts/extract_files.sh
24+
env:
25+
FILES_PASSPHRASE: ${{ secrets.FILES_PASSPHRASE }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
30+
if [ -f requirements-mupdf.txt ]; then pip install -r requirements-mupdf.txt; fi
31+
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
32+
- name: Test with pytest
33+
run: |
34+
pytest
35+
env:
36+
BAD_CAS_FILE: ${{ secrets.BAD_CAS_FILE }}
37+
CAMS_CAS_FILE: ${{ secrets.CAMS_CAS_FILE }}
38+
CAMS_CAS_PASSWORD: ${{ secrets.CAMS_CAS_PASSWORD }}
39+
KFINTECH_CAS_FILE: ${{ secrets.KFINTECH_CAS_FILE }}
40+
KFINTECH_CAS_PASSWORD: ${{ secrets.KFINTECH_CAS_PASSWORD }}
41+
- name: Upload coverage report to codecov
42+
uses: codecov/codecov-action@v1
43+
with:
44+
file: ./coverage.xml

.travis.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
44
[![GitHub](https://img.shields.io/github/license/codereverser/casparser)](https://github.com/codereverser/casparser/blob/main/LICENSE)
5-
[![Travis CI](https://img.shields.io/travis/codereverser/casparser)](https://travis-ci.org/github/codereverser/casparser)
5+
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/codereverser/casparser/run-tests)
66
[![Codecov](https://img.shields.io/codecov/c/github/codereverser/casparser)](https://codecov.io/gh/codereverser/casparser)
77
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/casparser)
88

requirements-mupdf.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
PyMuPDF==1.18.1
1+
PyMuPDF==1.18.5

tests/files.enc

-26.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)