Skip to content

Commit

Permalink
ci: Improve workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati committed Feb 19, 2024
1 parent f17cee2 commit a7e3ee4
Showing 1 changed file with 45 additions and 19 deletions.
64 changes: 45 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,53 @@
name: Pytest
name: Seria's CI

on: [push]
on:
push:
branches:
- main
schedule:
- cron: '0 0 * * 1' # every Monday at 00:00
workflow_dispatch:

jobs:
build:

create-release:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Create release
uses: seriaati/create-release@main

update-deps:
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Update dependencies & pre-commits
uses: seriaati/update-deps@main

pytest:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.11'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
python-version: 3.11

- name: Install and configure Poetry
uses: snok/install-poetry@v1

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install pytest-asyncio
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
pytest
run: poetry install --with dev

- name: Run pytest
run: poetry run pytest

0 comments on commit a7e3ee4

Please sign in to comment.