Skip to content

test

test #1192

Workflow file for this run

name: test
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
schedule:
- cron: "0 5 * * *"
concurrency:
group: test-${{ github.head_ref }}
cancel-in-progress: true
env:
PYTHONUNBUFFERED: 1
FORCE_COLOR: 1
jobs:
test:
name: test / py ${{ matrix.python-version }} / notebook ${{ matrix.jupyter-version }}
strategy:
fail-fast: false
matrix:
# os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.9, "3.10", 3.11]
jupyter-version: ["5.*", "6.3", "6.4", "6.*", "7.0"]
runs-on: ubuntu-latest
# Can't use Minio official image because we can't specify the docker command in Github Actions
# https://github.521000.bestmunity/t5/GitHub-Actions/Job-service-command/m-p/33901
# https://github.521000.bestmunity/t5/GitHub-Actions/Specify-command-in-job-service-container/m-p/40616
services:
minio:
image: getfider/minio:0.0.2
# image: minio/minio:RELEASE.2018-06-29T02-11-29Z
# command: server /export
ports:
- 9000:9000
- 9001:9001
env:
MINIO_ACCESS_KEY: access-key
MINIO_SECRET_KEY: secret-key
volumes:
- /tmp/tmp-data:/data
steps:
- uses: actions/checkout@v3
- uses: arduino/setup-task@v1
# ------------------------------------------------------------------------
# Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
id: cached-python-env
with:
path: ${{ env.pythonLocation }}
key: >
python
${{ runner.os }}
python-${{ matrix.python-version }}
jupyter-${{ matrix.jupyter-version }}
${{ hashFiles('pyproject.toml') }}
${{ hashFiles('requirements/*') }}
- name: Install dependencies
if: steps.cached-python-env.outputs.cache-hit != 'true'
run: |
pip install -r requirements/all.txt
pip install -U notebook==${{ matrix.jupyter-version }}
- name: Install Hatch
run: |
pip install --upgrade hatch
- name: Print Python info
run: |
which python
python --version
which pip
pip --version
pip freeze
# ------------------------------------------------------------------------
# Build and test
- name: Verify Minio
run: |
sudo mkdir -p /tmp/tmp-data/notebooks
curl http://localhost:9000/
- name: Build package
run: task build
- name: Install package
run: |
pip install dist/*.tar.gz
pip freeze
- name: Run tests
run: |
task test-all
task report
- name: Codecov
uses: codecov/codecov-action@v2
with:
file: ./coverage.xml
- name: Upload test results to GitHub
uses: actions/upload-artifact@v2
if: failure()
with:
name: test-results-py${{ matrix.python-version }}
path: htmlcov