Skip to content

Commit

Permalink
Adds CI pipeline code for PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
y4izus committed Jun 24, 2024
1 parent 6b6a846 commit 5eb5397
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/.workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI Pipeline

on:
pull_request:
branches:
- "*"
paths-ignore:
- '[skip ci]'

jobs:
fetch-repository:
uses: ./.github/workflows/reusable_checkout.yml

run-lint:
needs: fetch-repository
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
- name: Run lint
run: |
python -m black --check .
run-tests:
needs: fetch-repository
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.11, 3.8]

steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
- name: Run tests
run: |
python -m pytest .
16 changes: 16 additions & 0 deletions .github/.workflows/reusable_checkout.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Reusable Checkout

on:
workflow_call:

jobs:
checkout:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
repository: ${{ github.repository }}
ref: ${{ github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 2

0 comments on commit 5eb5397

Please sign in to comment.