Skip to content

Commit

Permalink
Merge pull request #46 from dimas9009/fix-pipline-github
Browse files Browse the repository at this point in the history
Fix GitHub pipeline for running unit tests
  • Loading branch information
allard-mx authored Apr 29, 2024
2 parents 148d2be + c59ffbd commit 9f88578
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 10 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/scripts/runapp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: "2.3"

services:
mendixapp:
image: mxbuildpack
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"]
interval: 15s
retries: 2
start_period: 10s
timeout: 3s
environment:
ADMIN_PASSWORD: Password1!
DATABASE_ENDPOINT: postgres://mendix:mendix@db:5432/mendix
ports:
- 8080:8080
links:
- db
db:
image: postgres:13
healthcheck:
test: ["CMD", "pg_isready", "-U", "mendix"]
interval: 5s
retries: 10
start_period: 10s
timeout: 2s
environment:
- POSTGRES_USER=mendix
- POSTGRES_PASSWORD=mendix
18 changes: 8 additions & 10 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,9 @@ jobs:
- uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 # v2
with:
repository: 'mendix/docker-mendix-buildpack'
ref: 'latest'
path: 'build-pack'

- uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 # v2
with:
repository: 'mendixlabs/mx-docker-tools'
path: 'mx-tools'

- name: Define MX_VERSION
run: |
cd $GITHUB_WORKSPACE/app/Source
Expand All @@ -44,7 +40,8 @@ jobs:
echo "MX_VERSION=$VERSION" >> $GITHUB_ENV
- name: Create build directory
run: mkdir build-pack/build
run: |
mkdir build-pack/build
- name: Create output directory
run: mkdir $GITHUB_WORKSPACE/out
Expand All @@ -55,12 +52,13 @@ jobs:
- name: Build docker image
run: |
cd build-pack
make build-image
docker build -t mendix-rootfs:app -f rootfs-app.dockerfile .
docker build -t mendix-rootfs:builder -f rootfs-builder.dockerfile .
docker build -t mxbuildpack --build-arg BUILD_PATH=build .
- name: Run docker image
- name: Run application
run: |
cd build-pack
make run-container &
docker-compose -f $GITHUB_WORKSPACE/app/.github/workflows/scripts/runapp.yml up &
timeout 60s bash -c 'until curl -s http://localhost:8080 | grep "<title>Mendix</title>"; do sleep 5; done'
- name: Start unit tests
Expand Down

0 comments on commit 9f88578

Please sign in to comment.