-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
50 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ on: | |
env: | ||
ACTIONS_RUNNER_DEBUG: true | ||
ACTIONS_STEP_DEBUG: true | ||
NIPAPD_CI_TAG: nipap/nipapd:ci | ||
WWW_CI_TAG: nipap/nipap-www:ci | ||
|
||
jobs: | ||
test: | ||
|
@@ -27,16 +29,6 @@ jobs: | |
- name: "Check out NIPAP repository" | ||
uses: actions/checkout@v2 | ||
|
||
- name: "Hadolint nipapd" | ||
uses: hadolint/[email protected] | ||
with: | ||
Dockerfile: Dockerfile.nipapd | ||
|
||
- name: "Hadolint WWW" | ||
uses: hadolint/[email protected] | ||
with: | ||
Dockerfile: Dockerfile.www | ||
|
||
- name: "Install dependencies and prepare NIPAP" | ||
run: | | ||
# Set up NIPAP repo | ||
|
@@ -175,3 +167,51 @@ jobs: | |
sudo cat /var/log/syslog || true | ||
sudo cat /var/log/postgresql/postgresql-*-main.log || true | ||
sudo cat /tmp/nipap.log || true | ||
docker: | ||
name: "Test Docker deployment" | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
|
||
- name: "Set up QEMU" | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: "Set up Docker Buildx" | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: "Hadolint nipapd" | ||
uses: hadolint/[email protected] | ||
with: | ||
Dockerfile: Dockerfile.nipapd | ||
|
||
- name: "Hadolint WWW" | ||
uses: hadolint/[email protected] | ||
with: | ||
Dockerfile: Dockerfile.www | ||
|
||
- name: "Build nipapd Docker image" | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./Dockerfile.nipapd | ||
load: true | ||
tags: ${{ env.NIPAPD_CI_TAG }} | ||
push: false | ||
|
||
- name: "Build www Docker image" | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./Dockerfile.www | ||
load: true | ||
tags: ${{ env.WWW_CI_TAG }} | ||
push: false | ||
|
||
- name: "Run Docker test suite" | ||
run: | | ||
# Set up database | ||
sudo su -c "cd nipap/sql; PGPASSWORD=papin make install" postgres | ||
docker run --network=host --rm -d --name=nipapd_ci -e DB_HOST=127.0.0.1 -e DB_USERNAME=nipap -e DB_PASSWORD=papin ${{ env.NIPAPD_CI_TAG }} | ||
sleep 5 | ||
docker logs nipapd_ci |