Skip to content

Instantly share code, notes, and snippets.

@CalebEverett
Last active March 3, 2021 20:03
Show Gist options
  • Save CalebEverett/f5c69669e7f5e96b310d40d0b39f012f to your computer and use it in GitHub Desktop.
Save CalebEverett/f5c69669e7f5e96b310d40d0b39f012f to your computer and use it in GitHub Desktop.
Github actions build for cscs_utils
name: build status
env:
CANVAS_TOKEN: ${{ secrets.CANVAS_TOKEN }}
CANVAS_URL: https://canvas.harvard.edu
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
CSCI_SALT: ${{ secrets.CSCI_SALT }}
on:
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pipenv
pipenv install --dev --ignore-pipfile --deploy
- name: Install and setup code coverage tool
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Run tests
run: |
pipenv run pytest --cov-report xml --cov-report term
- name: Report coverage to codeclimate
run: |
./cc-test-reporter after-build --exit-code 0
submit:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Get history and tags for SCM versioning to work
run: |
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Install dependencies
run: |
python -m pip install .
- name: Submit to Canvas
run: |
python setup.py --version
python submit.py
build:
needs: submit
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
include:
- python: 3.6
toxenv: 'py36'
- python: 3.7
toxenv: 'py37'
- python: 3.8
toxenv: 'py38'
- python: 3.9
toxenv: 'py39'
steps:
- uses: actions/checkout@v2
- name: Setup
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install tox
run: |
python -m pip install --upgrade tox
- name: Run tox
env:
TOXENV: ${{ matrix.toxenv }}
run: |
tox -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment