Skip to content

Commit 284aeae

Browse files
committed
Migrate CI from circleci to github actions
1 parent 45fc878 commit 284aeae

File tree

3 files changed

+68
-85
lines changed

3 files changed

+68
-85
lines changed

.circleci/config.yml

Lines changed: 0 additions & 62 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CI
2+
3+
on:
4+
workflow_call:
5+
pull_request:
6+
# NOTE: For develop & master, they are run through helm github action ./build-publish-docker-helm.yml
7+
8+
9+
jobs:
10+
pre_commit_checks:
11+
name: 🚴 Pre-Commit checks 🚴
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@main
16+
- name: Install poetry
17+
run: pipx install poetry
18+
- uses: actions/setup-python@main
19+
with:
20+
cache: 'poetry'
21+
- run: poetry install
22+
- uses: pre-commit/action@main
23+
24+
test:
25+
name: 🚴 Checks & Test 🚴
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- uses: actions/checkout@main
30+
31+
- name: 🐳 Set up Docker Buildx
32+
id: buildx
33+
uses: docker/setup-buildx-action@v3
34+
35+
- name: 🐳 Build image
36+
uses: docker/build-push-action@v6
37+
with:
38+
context: .
39+
file: Dockerfile
40+
push: false
41+
load: true
42+
tags: ifrcgo/go-api:latest
43+
cache-from: type=gha
44+
cache-to: type=gha,mode=max
45+
46+
- name: Docker config setup & Pull docker images
47+
run: |
48+
cp .env-sample .env &&
49+
docker compose run --rm serve ls
50+
51+
- name: 🕮 Validate if there are no pending django migrations.
52+
run: |
53+
docker compose run --rm serve ./manage.py makemigrations --check --dry-run || {
54+
echo 'There are some changes to be reflected in the migration. Make sure to run makemigrations';
55+
exit 1;
56+
}
57+
58+
- name: 🕮 Validate SentryMonitor config
59+
run: |
60+
docker compose run --rm serve ./manage.py cron_job_monitor --validate-only || {
61+
echo 'There are some changes to be reflected in the SentryMonitor. Make sure to update SentryMonitor';
62+
exit 1;
63+
}
64+
65+
- name: 🤞 Run Test 🧪
66+
run: |
67+
time docker compose run --rm serve ./manage.py test --keepdb -v 2 --pattern="test_fake.py" &&
68+
docker compose run --rm serve pytest --reuse-db --durations=10

0 commit comments

Comments
 (0)