Skip to content

Commit

Permalink
Github CI (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
gatesn authored Aug 31, 2023
1 parent de9c8ca commit a520d8e
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: CI

on:
push:
branches: ["develop"]
pull_request:
branches: ["develop"]

permissions:
actions: read
contents: read

env:
POETRY_VERSION: "1.6.1"
PYTHON_VERSION: "3.11"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
id: setup-python
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v3
with:
path: ~/.local
key: poetry-${{ runner.os }}-${{ env.POETRY_VERSION }}-${{ steps.setup-python.outputs.python-version }}
- name: Install Poetry
id: install-poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Poetry git plugin
run: poetry self add poetry-git-version-plugin

- name: Setup Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.11.0
- name: Zig Build Test
run: zig build test

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Poetry Install
run: poetry install -n -v
- name: Poetry Build
run: poetry build -v

- name: Ruff
run: poetry run ruff .
- name: Black
run: poetry run black .

0 comments on commit a520d8e

Please sign in to comment.