Newer
Older
push:
branches:
- master
pull_request:
paths-ignore:
- "doc/*.rst"
schedule:
- cron: "17 3 * * 0"
lint:
name: Lint and typecheck
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: dschep/install-poetry-action@v1.3
with:
create_virtualenvs: true
- name: Cache python dependencies
uses: actions/cache@v2
id: cache
with:
path: ~/.cache/pypoetry
key: poetry-${{ hashFiles('**/poetry.lock') }}-${{ matrix.python-version }}
restore-keys: |
poetry-${{ hashFiles('**/poetry.lock') }}-${{ matrix.python-version }}
- name: Install Dependencies
run: poetry install
if: steps.cache.outputs.cache-hit != 'true'
- name: "Flake8"
run: poetry run flake8 relate course accounts tests
- name: "Mypy"
run: poetry run mypy relate course
pytest:
name: Python ${{ matrix.python-version }} - ${{ matrix.suite }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
suite: ['base', 'postgres', 'expensive']
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: relatepgpass
POSTGRES_DB: test_relate
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: dschep/install-poetry-action@v1.3
with:
create_virtualenvs: true
- name: Cache python dependencies
uses: actions/cache@v2
path: ~/.cache/pypoetry
key: poetry-${{ hashFiles('**/poetry.lock') }}-${{ matrix.python-version }}
poetry-${{ hashFiles('**/poetry.lock') }}-${{ matrix.python-version }}
- name: Install Dependencies
run: poetry install
if: steps.cache.outputs.cache-hit != 'true'
- name: Install OS dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get install gettext
- name: Run test suite
env:
RL_CI_TEST: ${{ matrix.suite }}
bash ./.ci/run-tests-for-ci.sh
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
- name: Test command line tool
if: matrix.suite == 'base'
run: |
git clone https://github.com/inducer/relate-sample
cd relate-sample
poetry run relate validate .
poetry run relate test-code questions/autograded-python-example.yml
poetry run relate expand-yaml flows/quiz-test.yml > /dev/null
# pytest-windows:
# name: Python - Windows
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-python@v1
# with:
# python-version: 3.7
# - name: Install Poetry
# uses: dschep/install-poetry-action@v1.3
# - name: Confiure Poetry
# run: |
# poetry config virtualenvs.in-project true
# - name: Cache python dependencies
# uses: actions/cache@v2
# id: cache
# with:
# path: .venv
# key: pypoetry-${{ hashFiles('**/poetry.lock') }}-windows
# restore-keys: |
# pypoetry-${{ hashFiles('**/poetry.lock') }}-windows
# - name: Install Dependencies
# run: poetry install
# if: steps.cache.outputs.cache-hit != 'true'
# - name: Run test suite
# env:
# RELATE_LOCAL_TEST_SETTINGS: "local_settings_example.py"
# run: |
# poetry run pytest --cov-config=setup.cfg --cov-report=xml --cov=.
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v1
# with:
# fail_ci_if_error: true