Skip to content

end-to-end-flow

end-to-end-flow #1030

# This is a basic workflow to help you get started with Actions
name: end-to-end-flow
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
pull_request:
branches: [ master ]
# Docs: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onschedule
schedule:
# cron expression placeholders (https://crontab.guru/#0_1_*_*_*):
# minute hour day(month) month day(week)
- cron: '0 1 * * *' # at 01:00 every night
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
if: contains(toJson(github.event.commits), '[skip ci]') == false
strategy:
matrix:
python-version: ["3.7", "3.8"]
os: [windows-latest, ubuntu-18.04]
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
timeout-minutes: 15
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache multiple paths
uses: actions/cache@v2
with:
path: |
~/.cache/pip
~\AppData\Local\pip\Cache
$RUNNER_TOOL_CACHE/Python/*
key: ${{ runner.os }}-${{ matrix.python-version }}-build
# Runs a single command using the runners shell
- name: install-dev-requirements
run: python -m pip install --upgrade -r requirements-dev.txt
- name: install-dev-requirements-nix-specific
run: python -m pip install --upgrade -r requirements-nix-dev.txt
if: matrix.os != 'windows-latest'
- name: install-line-profiler-on-windows-python-3.7
run: |
### https://stackoverflow.com/questions/5419/python-unicode-and-the-windows-console
### https://github.com/conda/conda/issues/7445#issuecomment-774579800
set PYTHONIOENCODING="utf-8"
set PYTHONLEGACYWINDOWSSTDIO="utf-8"
pip install win-unicode-console
python -m pip install line-profiler@https://github.com/neomatrix369/nlp_profiler/releases/download/v0.0.2-dev/line_profiler-3.2.6-cp37-cp37m-win_amd64.whl
if: matrix.python-version == '3.7' && matrix.os == 'windows-latest'
- name: install-line-profiler-on-windows-python-3.8
run: |
### https://stackoverflow.com/questions/5419/python-unicode-and-the-windows-console
### https://github.com/conda/conda/issues/7445#issuecomment-774579800
pip install win-unicode-console
python -m pip install line-profiler@https://github.com/neomatrix369/nlp_profiler/releases/download/v0.0.2-dev/line_profiler-3.2.6-cp38-cp38-win_amd64.whl
if: matrix.python-version == '3.8' && matrix.os == 'windows-latest'
- name: install-requirements
run: python -m pip install --upgrade -r requirements.txt
# Runs a set of commands using the runners shell
- name: run-test-coverage-shell-script
shell: bash
env:
PYTHONUTF8: 1
PYTHONIOENCODING: utf-8
PYTHONLEGACYWINDOWSSTDIO: utf-8
run: |
./test-coverage.sh "tests slow-tests"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
if: matrix.python-version == '3.8' && matrix.os == 'ubuntu-18.04'
with:
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: true
- name: Archive build and test artifacts
uses: actions/upload-artifact@v2
with:
name: test-reports-and-cprofile-reports
path: |
.coverage
.test-run-reports/**/*.*
.cprofile/**/*.*
- name: Archive code coverage results
uses: actions/upload-artifact@v2
with:
name: test-coverage-reports
path: |
.coverage-reports/**/*.*