Merge pull request #194 from akrherz/230920 #55
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: pydep CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
defaults: | |
run: | |
# Ensures environment gets sourced right | |
shell: bash -l {0} | |
name: Build and Test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
PYTHON_VERSION: ["3.9", "3.10", "3.11"] | |
env: | |
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Add /etc/hosts entries | |
run: | | |
cat .github/workflows/etchosts.txt | sudo tee -a /etc/hosts | |
# setup conda-forge with micromamba | |
- name: Setup Python | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: environment.yml | |
condarc: | | |
channels: | |
- conda-forge | |
- defaults | |
create-args: >- | |
python=${{ env.PYTHON_VERSION }} | |
environment-name: prod | |
cache-environment: true | |
- name: Setup Postgres | |
run: | | |
git clone --depth 1 https://github.com/akrherz/iem-database.git database | |
git clone --depth 1 https://github.com/akrherz/ci_tooling.git .ci_tooling | |
. .ci_tooling/postgres.sh | |
cd database; sh bootstrap.sh | |
python schema_manager.py | |
- name: Setup Memcached | |
run: | | |
. .ci_tooling/memcached.sh | |
- name: Build and test | |
run: | | |
python -m pip install . --upgrade --no-deps | |
coverage run --source=pydep setup.py test | |
coverage xml | |
- name: Upload codecov | |
if: ${{ env.PYTHON_VERSION == '3.11' }} | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage.xml |