Skip to content

Commit

Permalink
[brief] Adds CI actions.
Browse files Browse the repository at this point in the history
[detailed]
  • Loading branch information
marovira committed Mar 24, 2024
1 parent 8e90bdb commit c2bc5b6
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: PyTest

on:
push:
branches: [ master ]
paths-ignore:
- 'README.md'
- '.pre-commit-config.yaml'
- 'data/**'
- "LICENSE"
pull_request:
branches: [ master ]
paths-ignore:
- 'README.md'
- 'LICENSE'
workflow_dispatch:

jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
stategy:
fail-fast: false
matrix:
config:
- {
name: "Linux",
os: ubunut-latest,
}
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
id: setup_python
with:
python-version: "3.11"

- name: Cache virtualenv
uses: actions/cache@v3
with:
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version}}-${{ hashFiles('requirements/ci.txt') }}
path: venv

- name: Install dependencies
run: |
python -m venv venv
source venv/bin/activate
python -m pip install -r requirements/ci.txt
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
- name: Install Pyro
shell: bash
run: |
pip install .
ruff check src/pyro
- name: Test
run: |
pytest
61 changes: 61 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Ruff

on:
push:
branches: [ master ]
paths-ignore:
- 'README.md'
- '.pre-commit-config.yaml'
- 'data/**'
- "LICENSE"
pull_request:
branches: [ master ]
paths-ignore:
- 'README.md'
- 'LICENSE'
workflow_dispatch:

jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
stategy:
fail-fast: false
matrix:
config:
- {
name: "Linux",
os: ubunut-latest,
}
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
id: setup_python
with:
python-version: "3.11"

- name: Cache virtualenv
uses: actions/cache@v3
with:
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version}}-${{ hashFiles('requirements/ci.txt') }}
path: venv

- name: Install dependencies
run: |
python -m venv venv
source venv/bin/activate
python -m pip install -r requirements/ci.txt
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
- name: Install Pyro
shell: bash
run: |
pip install .
ruff check src/pyro
- name: Lint
run: |
ruff check src/pyro
ruff check test

0 comments on commit c2bc5b6

Please sign in to comment.