-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate CI from circleci to github actions
- Loading branch information
Showing
3 changed files
with
52 additions
and
62 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,52 @@ | ||
name: Run Test | ||
|
||
on: | ||
workflow_call: | ||
pull_request: | ||
|
||
permissions: | ||
id-token: write # This is required for requesting the JWT | ||
contents: read # This is required for actions/checkout | ||
|
||
jobs: | ||
test: | ||
name: 🚴 Test 🚴 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@main | ||
|
||
- name: 🐳 Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: 🐳 Build image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
push: false | ||
load: true | ||
tags: ifrcgo/go-api:latest | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: 🕮 Validate if there are no pending django migrations. | ||
run: | | ||
cp .env-sample .env && | ||
docker compose run --rm serve ./manage.py makemigrations --check --dry-run || { | ||
echo 'There are some changes to be reflected in the migration. Make sure to run makemigrations'; | ||
exit 1; | ||
} | ||
- name: 🕮 Validate SentryMonitor config | ||
run: | | ||
docker compose run --rm serve ./manage.py cron_job_monitor --validate-only || { | ||
echo 'There are some changes to be reflected in the SentryMonitor. Make sure to update SentryMonitor'; | ||
exit 1; | ||
} | ||
- name: 🤞 Run Test 🧪 | ||
run: | | ||
time docker compose run --rm serve ./manage.py test --keepdb -v 2 --pattern="test_fake.py" && | ||
docker compose run --rm serve pytest --reuse-db --durations=10 |
File renamed without changes.