Marc Cataford
eacc51aa62
build: pytest call build: set up venv test: snapshot update, formatting chore: author info formatting chore: author info formatting build: includes ci: release update docs: set_version
118 lines
3 KiB
YAML
118 lines
3 KiB
YAML
name: CICD
|
|
|
|
on:
|
|
push:
|
|
branches: main
|
|
pull_request:
|
|
|
|
jobs:
|
|
setup:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python: [3.7, 3.8, 3.9]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python }}
|
|
- uses: actions/cache@v2
|
|
id: dep-cache
|
|
with:
|
|
key: ${{ runner.os }}-py${{ matrix.python }}-${{ hashFiles('requirements_dev.txt') }}
|
|
path: |
|
|
./slack-status-cli.venv
|
|
- name: Setup dependencies
|
|
if: steps.dep-cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
. script/bootstrap
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
needs: setup
|
|
strategy:
|
|
matrix:
|
|
python: [3.7, 3.8, 3.9]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python }}
|
|
- uses: actions/cache@v2
|
|
id: dep-cache
|
|
with:
|
|
key: ${{ runner.os }}-py${{ matrix.python }}-${{ hashFiles('requirements_dev.txt') }}
|
|
path: |
|
|
./slack-status-cli.venv
|
|
- name: Setup dependencies
|
|
run: |
|
|
. script/bootstrap
|
|
- name: Tests
|
|
run: |
|
|
python -m pytest --cov-report xml --cov=slack_status_cli -s
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: coverage-report
|
|
path: ./coverage.xml
|
|
|
|
coverage:
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/download-artifact@v2
|
|
with:
|
|
name: coverage-report
|
|
path: ./
|
|
- name: Upload coverage
|
|
uses: codecov/codecov-action@v2
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
files: ./coverage.xml
|
|
fail_ci_if_error: true
|
|
verbose: true
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
needs: setup
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.9
|
|
- uses: actions/cache@v2
|
|
id: dep-cache
|
|
with:
|
|
key: ${{ runner.os }}-py${{ matrix.python }}-${{ hashFiles('requirements_dev.txt') }}
|
|
path: |
|
|
./slack-status-cli.venv
|
|
- name: Setup dependencies
|
|
run: |
|
|
. script/bootstrap
|
|
- name: Lint and format
|
|
run: |
|
|
python -m pylint **/*.py
|
|
python -m black . --check
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
needs: setup
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.9
|
|
- uses: actions/cache@v2
|
|
id: dep-cache
|
|
with:
|
|
key: ${{ runner.os }}-py${{ matrix.python }}-${{ hashFiles('requirements_dev.txt') }}
|
|
path: |
|
|
./slack-status-cli.venv
|
|
- name: Setup dependencies
|
|
run: |
|
|
. script/bootstrap
|
|
- name: Lint and format
|
|
run: |
|
|
python -m build
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: current-build
|
|
path: dist/*
|
|
|