Skip to content

feat: add portal challenge #284

feat: add portal challenge

feat: add portal challenge #284

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: build
on:
pull_request:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, '3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest coveralls
pip install .
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest tests
# - name: Upload pytest test results
# uses: actions/upload-artifact@master
# with:
# name: pytest-results-${{ matrix.python-version }}
# path: htmlcov
# # Use always() to always run this step to publish test results when there are test failures
# if: ${{ always() }}
- name: Prepare environment for coveralls
run: |
echo "PYTHON_ENV=$(echo py${{ matrix.python-version }} | tr -d .)" >> $GITHUB_ENV
- name: Coveralls Parallel
env:
COVERALLS_FLAG_NAME: ${{ env.PYTHON_ENV }}
COVERALLS_PARALLEL: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coverage run --source=challengeutils --omit=challengeutils/__main__.py -m pytest tests/
coveralls --service=github
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: psf/black@stable
finish-coveralls:
needs: build
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finish Coveralls Parallel
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip3 install --upgrade coveralls
coveralls --finish