-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
7 changed files
with
340 additions
and
40 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,118 @@ | ||
name: Pre-merge Review | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
setup: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
python-cache-key: ${{ steps.cache-deps.outputs.cache-hit }} | ||
steps: | ||
# Step 1: Checkout code | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
# Step 2: Set up Python with caching | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
|
||
- name: Cache Python dependencies | ||
id: cache-deps | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache/pypoetry/virtualenvs | ||
.venv | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/poetry.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
# Step 3: Install dependencies | ||
- name: Install dependencies | ||
run: | | ||
pip install poetry | ||
poetry sync | ||
lint: | ||
needs: setup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Python cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache/pypoetry/virtualenvs | ||
.venv | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install Poetry | ||
run: | | ||
pip install poetry | ||
- name: Run styling checks | ||
run: make style-check | ||
|
||
type-check: | ||
needs: setup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Python cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache/pypoetry/virtualenvs | ||
.venv | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install Poetry | ||
run: | | ||
pip install poetry | ||
- name: Run type checks | ||
run: make type-check | ||
|
||
test: | ||
needs: setup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Python cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache/pypoetry/virtualenvs | ||
.venv | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install Poetry | ||
run: | | ||
pip install poetry | ||
- name: Start services | ||
run: | | ||
IS_CI="True" make init | ||
- name: Check database schema migrations | ||
run: make check-db-schema | ||
|
||
- name: Run tests | ||
env: | ||
TEST_STRIPE_SECRET_KEY: ${{ secrets.TEST_STRIPE_SECRET_KEY }} | ||
run: | | ||
echo STRIPE_SECRET_KEY=${{ secrets.TEST_STRIPE_SECRET_KEY }} >> .env.local | ||
echo STRIPE_DEVICE_NAME=CI >> .env.local | ||
DEPLOYMENT_ENV=testing poetry run pytest | ||
- name: Cleanup resources | ||
run: | | ||
make kill | ||
docker system prune --force --volumes |
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
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
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
Oops, something went wrong.