build using docker compose #32
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
name: Build | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build | |
run: | | |
set -euxo pipefail | |
docker compose build | |
docker compose --profile test build | |
- name: Test | |
run: | | |
set -euxo pipefail | |
# execute the gitea git server. | |
docker compose up --detach | |
# wait for gitea to be available. | |
GIT_USER_USERNAME=jane.doe | |
GIT_USER_PASSWORD=password | |
while [ -z "$( | |
curl \ | |
-s \ | |
-u "$GIT_USER_USERNAME:$GIT_USER_PASSWORD" \ | |
-X GET \ | |
-H 'Accept: application/json' \ | |
"http://localhost:3000/api/v1/repos/$GIT_USER_USERNAME/test" \ | |
| grep test)" ]; do | |
sleep 3 | |
done | |
# execute our application. | |
docker compose run test | |
# list the local repository log. | |
git --git-dir tmp/test/.git log --oneline |