Unify Python requirements #646
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" | |
on: | |
pull_request: | |
push: | |
branches: | |
- "qa/**" | |
- "stable/**" | |
jobs: | |
test: | |
name: "Test Python ${{ matrix.python-version }}" | |
runs-on: "ubuntu-22.04" | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10"] | |
steps: | |
- name: "Check out repository" | |
uses: "actions/checkout@v3" | |
- name: "Set up Python ${{ matrix.python-version }}" | |
uses: "actions/setup-python@v4" | |
with: | |
python-version: "${{ matrix.python-version }}" | |
cache: "pip" | |
cache-dependency-path: | | |
requirements-dev.txt | |
- name: "Install OS packages" | |
run: | | |
sudo apt-get --quiet update | |
sudo apt-get install --quiet --yes build-essential \ | |
libmysqlclient-dev libsasl2-dev libldap2-dev libssl-dev \ | |
p7zip-full unar | |
- name: "Create directories needed by test_duracloud.py" | |
run: | | |
sudo mkdir -p /var/archivematica/storage_service | |
sudo chown -R $USER /var/archivematica/storage_service | |
- name: "Install tox" | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox tox-gh-actions | |
- name: "Run tox with coverage" | |
env: | |
PYTEST_ADDOPTS: -vv --cov storage_service --cov-config=.coveragerc --cov-report xml:coverage.xml | |
run: | | |
tox | |
- name: "Upload coverage report" | |
if: github.repository == 'artefactual/archivematica-storage-service' | |
uses: "codecov/codecov-action@v3" | |
with: | |
files: ./coverage.xml | |
fail_ci_if_error: false | |
verbose: true | |
integration: | |
name: "Integration ${{ matrix.ubuntu-version }} with ${{ matrix.python-version }}" | |
runs-on: "ubuntu-22.04" | |
strategy: | |
fail-fast: false | |
matrix: | |
ubuntu-version: ["20.04", "22.04"] | |
python-version: ["3.8", "3.9", "3.10"] | |
steps: | |
- name: "Check out repository" | |
uses: "actions/checkout@v3" | |
- name: "Run tests" | |
run: | | |
./run.sh | |
shell: "bash" | |
working-directory: "integration" | |
env: | |
UBUNTU_VERSION: ${{ matrix.ubuntu-version }} | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
COMPOSE_DOCKER_CLI_BUILD: 1 | |
DOCKER_BUILDKIT: 1 | |
PYTEST_ADDOPTS: -vv | |
linting: | |
name: "Lint" | |
runs-on: "ubuntu-22.04" | |
steps: | |
- name: "Check out repository" | |
uses: "actions/checkout@v3" | |
- name: "Set up Python 3.9" | |
uses: "actions/setup-python@v4" | |
with: | |
python-version: "3.9" | |
- name: "Install tox" | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: "Run tox" | |
run: | | |
tox -e linting |