-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3af62b4
commit 6b6750f
Showing
1 changed file
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Test And Release | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
name: Run Tests / OS ${{ matrix.os }} / Python ${{ matrix.python-version }} | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
python-version: ["3.10", "3.11", "3.12", "3.13"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
- name: Install brew | ||
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | ||
|
||
- name: Install Supabase | ||
run: brew install supabase/tap/supabase | ||
|
||
- name: Start supabase | ||
run: supabase start | ||
|
||
- name: Update .env | ||
run: bash scripts/update-env.sh | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
run: uv python install ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
cd backend | ||
uv sync --python ${{ matrix.python-version }} --all-extras --dev | ||
- name: Run tests | ||
run: | | ||
uv run bash scripts/pre-start.sh | ||
uv run bash scripts/tests-start.sh | ||
release: | ||
name: Bump Version and Release | ||
needs: test | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/tags/') | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
|
||
- name: Install dependencies | ||
run: uv sync --dev | ||
|
||
- name: Generate a changelog | ||
env: | ||
ATTICUS_PAT: ${{ secrets.ATTICUS_PAT }} | ||
run: uv run git-cliff -vv --latest --strip header --github-token "$ATTICUS_PAT" -o CHANGES.md | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
body_path: CHANGES.md | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Reference | ||
# 1. https://docs.astral.sh/uv/guides/integration/github/#syncing-and-running | ||
# 2. https://github.com/Kludex/python-template/blob/main/.github/workflows/main.yml | ||
# 3. https://github.com/softprops/action-gh-release/tree/master/ |