-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github workflow for analytics migrations
- Loading branch information
Showing
1 changed file
with
43 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,43 @@ | ||
name: Check Analytics Migrations | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
# - "analytics/analytics/**" | ||
- "analytics/analytics/*" | ||
|
||
jobs: | ||
# This prevents unnecessary runs, as the pull_request.paths event qualifier doesn't seem to correctly dispatch synchronize events | ||
# check-modified-paths: | ||
# if: ${{ github.event_name == 'pull_request' }} | ||
# runs-on: ubuntu-latest | ||
# outputs: | ||
# result: ${{ steps.main.outputs.result }} | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v3 | ||
# with: | ||
# fetch-depth: 0 | ||
|
||
# - name: Check for modified paths | ||
# id: main | ||
# run: "! git diff --quiet HEAD ${{ github.event.pull_request.base.sha }} -- analytics/analytics/; echo result=$? >> $GITHUB_OUTPUT" | ||
|
||
check-migrations: | ||
# needs: check-modified-paths | ||
# if: ${{ needs.check-modified-paths.outputs.result == 0 }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install requirements | ||
run: pip install -r ./analytics/requirements.txt | ||
|
||
- name: Provide default env vars for django | ||
run: cat ./analytics/dev/.env.docker-compose >> $GITHUB_ENV | ||
|
||
# This runs on pull requests and blocks until any necessary migrations have been created | ||
# *Note*: This will display a warning about not being able to connect to a database. This can be ignored. | ||
- name: Check for Migrations | ||
run: ./analytics/manage.py makemigrations --check --noinput |