Skip to content

Commit

Permalink
Import GHA from #37
Browse files Browse the repository at this point in the history
  • Loading branch information
bernt-matthias authored and hexylena committed Sep 13, 2023
1 parent 6a75716 commit 4e21648
Showing 1 changed file with 82 additions and 0 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Test Pull Request

on: [push,pull_request]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8']
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache .cache/pip
uses: actions/cache@v3
id: cache-pip
with:
path: ~/.cache/pip
key: pip_cache_py_${{ matrix.python-version }}
- name: Install package
run: pip install -r requirements.txt black==23.3 flake8==6.0
- name: Flake8
run: flake8 --ignore=C901,W503
- name: Black
uses: psf/[email protected]
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8']
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache .cache/pip
uses: actions/cache@v3
id: cache-pip
with:
path: ~/.cache/pip
key: pip_cache_py_${{ matrix.python-version }}
- name: install package
run: python -m pip install .
- name: install packages for testing
run: pip install nose xmldiff
- name: run nosetests
run: nosetests --with-coverage --cover-package=galaxyxml

- name: Run smoke test on example
run: |
python examples/example.py > tmp.xml
xmldiff tmp.xml examples/tool.xml
python examples/example_macros.py > tmp.xml
xmldiff tmp.xml examples/example_macros.xml
deploy:
name: Deploy
needs: [lint, test]
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7']
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache .cache/pip
uses: actions/cache@v3
id: cache-pip
with:
path: ~/.cache/pip
key: pip_cache_py_${{ matrix.python-version }}
- uses: casperdcl/deploy-pypi@v2
with:
password: ${{ secrets.PYPI_TOKEN }}
build: --sdist --wheel --outdir dist .
# only upload if a tag is pushed (otherwise just build & check)
upload: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') }}

0 comments on commit 4e21648

Please sign in to comment.