38 lines
1.1 KiB
YAML
38 lines
1.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: "0 12 * * *"
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: '3.x'
|
|
- name: Install dependencies
|
|
run: pip install -r requirements.txt -r dev-requirements.txt
|
|
- name: Test
|
|
run: coverage run -m pytest
|
|
- name: Update(master)
|
|
if: ${{ github.ref == 'refs/heads/master' }}
|
|
env:
|
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
run: coverage run -a ./update.py --release
|
|
- name: Update
|
|
if: ${{ github.ref != 'refs/heads/master' }}
|
|
run: coverage run -a ./update.py
|
|
- name: Report coverage
|
|
env:
|
|
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
|
|
run: |
|
|
coverage xml && coverage report
|
|
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
|
chmod +x ./cc-test-reporter
|
|
./cc-test-reporter after-build
|