File tree Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build Test and Lint
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ pull_request :
8+
9+ jobs :
10+ build-test-and-lint :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Checkout code
15+ uses : actions/checkout@v3
16+
17+ - name : Set up Docker Buildx
18+ uses : docker/setup-buildx-action@v2
19+
20+ - name : Cache Docker layers
21+ uses : actions/cache@v3
22+ with :
23+ path : /tmp/.buildx-cache
24+ key : ${{ runner.os }}-buildx-${{ github.sha }}
25+ restore-keys : |
26+ ${{ runner.os }}-buildx-
27+
28+ - name : Build Docker image
29+ run : |
30+ make docker/build
31+
32+ - name : Run Docker container for tests
33+ run : |
34+ docker run --rm \
35+ -e DJANGO_SETTINGS_MODULE=intbot.settings \
36+ -e DATABASE_URL=postgres://testuser:testpassword@localhost:5432/testdb \
37+ --network host \
38+ intbot \
39+ make test
40+
41+ services :
42+ postgres :
43+ image : postgres:16.4
44+ env :
45+ POSTGRES_USER : testuser
46+ POSTGRES_PASSWORD : testpassword
47+ POSTGRES_DB : testdb
48+ ports :
49+ - 5432:5432
50+ options : >-
51+ --health-cmd="pg_isready -U testuser -d testdb"
52+ --health-interval=10s
53+ --health-timeout=5s
54+ --health-retries=5
55+
You can’t perform that action at this time.
0 commit comments