Skip to content

Commit

Permalink
feat: add GitHub Action CI for linting and testing on pull
Browse files Browse the repository at this point in the history
  • Loading branch information
richardnguyen99 committed Dec 28, 2023
1 parent 6fb6a68 commit 937e062
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# This GitHub Action will perform a checking of pull request to the main branch

name: CI

on:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install pylint
- name: Lint with pylint
id: pylint
continue-on-error: true
run: |
pylint --rcfile=.pylintrc --fail-under=9.0 --exit-zero *.py
- name: Lint with pylint
if: ${{ steps.pylint.outcome == 'failure' }}
run: |
echo "Pylint failed"
exit 1
- name: Run tests
run: |
python -m coverage run -m pytest
merge:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

# Merge pull request
- name: Merge pull request
uses: pascalgn/automerge-action@v0.13.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
merge-method: squash
delete-branch: true

0 comments on commit 937e062

Please sign in to comment.