Extract GHA From #37 #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
# TODO: replace with tox tests from #38 | |
#- 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') }} |