Skip to content

Commit

Permalink
Initial draft GitHub actions being added.
Browse files Browse the repository at this point in the history
  • Loading branch information
madpah committed Sep 2, 2021
1 parent e9a67f8 commit e2403e8
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: 'pip'
directory: '/'
schedule:
interval: 'weekly'
day: 'saturday'
allow:
- dependency-type: 'all'
versioning-strategy: 'auto'
labels: [ 'dependencies' ]
commit-message:
## prefix maximum string length of 15
prefix: 'poetry'
include: 'scope'
open-pull-requests-limit: 999
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
day: 'saturday'
labels: [ 'dependencies' ]
commit-message:
## prefix maximum string length of 15
prefix: 'gh-actions'
include: 'scope'
open-pull-requests-limit: 999
62 changes: 62 additions & 0 deletions .github/workflows/poetry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# For details of what checks are run for PRs please refer below
# docs: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: Python CI

on:
push:
branches: ["master"]
pull_request:
workflow_dispatch:
schedule:
# schedule weekly tests, since dependencies are not intended to be pinned
# this means: at 23:42 on Fridays
- cron: '42 23 * * 5'

env:
REPORTS_DIR: CI_reports

jobs:
build-and-test:
name: Build & Test (Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- "3.9" # highest and lowest supported
timeout-minutes: 30
steps:
- name: Checkout
# see https://github.com/actions/checkout
uses: actions/checkout@v2
- name: Create reports directory
run: mkdir ${{ env.REPORTS_DIR }}
- name: Setup Python Environment
# see https://github.com/actions/setup-python
uses: actions/setup-python@v2
with:
python-version: {{ matrix.python-version }}
architecture: 'x64'
- name: Install poetry
# see https://github.com/marketplace/actions/setup-poetry
uses: Gr1N/setup-poetry@v7
with:
poetry-version: 1.1.8
- name: Install dependencies
run: poetry install
- name: Ensure build successful
run: poetry build
- name: Run tox
run: tox
- name: Generate coverage reports
run: >
coverage report && coverage xml -o ${{ env.REPORTS_DIR }}/coverage.xml &&
coverage html -d ${{ env.REPORTS_DIR }}
- name: Artifact reports
if: ${{ ! cancelled() }}
# see https://github.com/actions/upload-artifact
uses: actions/upload-artifact@v2
with:
name: ${{ env.REPORTS_ARTIFACT }}
path: ${{ env.REPORTS_DIR }}
if-no-files-found: error

0 comments on commit e2403e8

Please sign in to comment.