Skip to content

Commit

Permalink
chore: add github actions
Browse files Browse the repository at this point in the history
Signed-off-by: ktro2828 <[email protected]>
  • Loading branch information
ktro2828 committed Oct 1, 2024
1 parent 1ea9d90 commit ec13376
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: build-and-test

on:
push:
branches: [main]
pull_request:
types: [opened, synchronize]
paths:
- "**"
- "!docs/**"
- "!README.md"
- "!.github/**"
- .github/workflows/build-and-test.yaml
workflow_dispatch:

jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.10, 3.12]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version-file: "pyproject.toml"
cache: "poetry"

- name: Install dependencies
run: poetry install

- name: Run tests
run: poetry run pytest
15 changes: 15 additions & 0 deletions .github/workflows/cancel-previous-workflows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: cancel-previous-workflows

on:
pull_request_target:

jobs:
cancel-previous-workflows:
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
workflow_id: all
all_but_latest: true
19 changes: 19 additions & 0 deletions .github/workflows/deploy-document.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: deploy-document

on:
push:
branches: [main]
workflow_dispatch:

jobs:
deplot-document:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version-file: "pyproject.toml"
cache: "poetry"
- run: poetry install
- run: poetry run mkdocs gh-deploy --force

0 comments on commit ec13376

Please sign in to comment.