-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
134 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
name: ci/cd | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
release: | ||
types: [created] | ||
schedule: | ||
- cron: '1 3 * * 1' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
if: github.event_name != 'release' | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'python' ] | ||
python-version: [3.6, 3.7, 3.8, 3.9] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 | ||
|
||
build: | ||
name: CI | ||
if: $${ github.event_name != 'release' || github.event_name != 'schedule' }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8, 3.9] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Cache pip artifacts | ||
uses: actions/cache@v2 | ||
with: | ||
# This path is specific to Ubuntu | ||
path: ~/.cache/pip | ||
# Look to see if there is a cache hit for the corresponding requirements file | ||
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
${{ runner.os }}- | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
python setup.py install | ||
#- name: Audit | ||
# run: | | ||
# pylama pyga -i E501 | ||
|
||
- name: Test ${{ matrix.test_number }} | ||
run: | | ||
python setup.py test | ||
# coverage run --source=pyga setup.py test | ||
#- name: Coveralls Parallel | ||
# uses: coverallsapp/github-action@master | ||
# with: | ||
# github-token: ${{ secrets.github_token }} | ||
# flag-name: run-${{ matrix.test_number }} | ||
# parallel: true | ||
|
||
#finish: | ||
# needs: build | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Coveralls Finished | ||
# uses: coverallsapp/github-action@master | ||
# with: | ||
# github-token: ${{ secrets.github_token }} | ||
# parallel-finished: true | ||
|
||
deploy: | ||
name: CD | ||
if: ${{ github.event_name == 'release' && github.event.release.action == 'released' }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters