[DRAFT] add CI tool for docker health check and initial ci workflow #28
Workflow file for this run
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: Test App Install | |
on: | |
pull_request: {} | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Environment Information | |
run: | | |
echo "====== Docker Info ======" | |
docker info | |
echo "=========================" | |
echo "== Docker Compose Info ==" | |
docker compose version | |
echo "=========================" | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.22.2" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Dependencies | |
shell: bash | |
run: | | |
pip install -r requirements.txt | |
- name: Install Go Dependencies | |
run: | | |
cd tools/docker-health-check | |
go mod download | |
go build -o ../../check_health cmd/main.go | |
chmod +x ../../check_health | |
# TODO: Find changed files | |
# TODO: for each app, loop over the ci/ directory and do the below process | |
- name: Render template | |
shell: bash | |
run: | | |
./main.py > docker-compose.yaml | |
- name: Preview template | |
shell: bash | |
run: | | |
# Print the parsed, by compose, template | |
# (as it will also remove empty lines) | |
docker compose -f docker-compose.yaml config | |
- name: Generate random project name | |
shell: bash | |
run: | | |
echo "PROJECT_NAME=$(openssl rand -hex 12)" >> $GITHUB_ENV | |
- name: Up containers | |
shell: bash | |
run: | | |
docker compose -p $PROJECT_NAME -f docker-compose.yaml up -d | |
- name: Wait containers | |
shell: bash | |
run: | | |
./check_health --project $PROJECT_NAME --files docker-compose.yaml |