[Rt-commit] branch github-actions-tests updated: Set up Docker networks in GitHub actions

Brett Smith brett at bestpractical.com
Thu Aug 5 17:29:56 UTC 2021


This is an automated email from the git hooks/post-receive script.

brett pushed a commit to branch github-actions-tests
in repository rtir.

The following commit(s) were added to refs/heads/github-actions-tests by this push:
     new f0091b80 Set up Docker networks in GitHub actions
f0091b80 is described below

commit f0091b804d33c149668bc9327bb304e1894394b0
Author: Brett Smith <brett at bestpractical.com>
AuthorDate: Thu Aug 5 13:29:01 2021 -0400

    Set up Docker networks in GitHub actions
    
    Setting up a user-managed network allows containers on the same network
    to address each other by name.
---
 .github/workflows/github-action.yml | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/github-action.yml b/.github/workflows/github-action.yml
index 53f619de..a6979cd8 100644
--- a/.github/workflows/github-action.yml
+++ b/.github/workflows/github-action.yml
@@ -55,11 +55,12 @@ jobs:
         uses: actions/checkout at v2
       - name: Build test environment
         run: |
-          docker run --detach --name rtdb --env MYSQL_ROOT_PASSWORD=password mariadb:10.3
-          docker build --build-arg RT_DB_TYPE=mysql --build-arg RT_TEST_DB_HOST=rtdb --tag rtir .
+          docker network create rt
+          docker run --detach --name rtdb --network rt --env MYSQL_ROOT_PASSWORD=password mariadb:10.3
+          docker build --build-arg RT_DB_TYPE=mysql --build-arg RT_TEST_DB_HOST=rtdb --network rt --tag rtir .
       - name: Run RTIR tests
         run: |
-          docker run --volume "$GITHUB_WORKSPACE:/rtir" rtir bash -c 'cd /rtir && perl Makefile.PL && make test-parallel'
+          docker run --network rt --volume "$GITHUB_WORKSPACE:/rtir" rtir bash -c 'cd /rtir && perl Makefile.PL && make test-parallel'
       - name: Get run time
         run: |
           RT_GA_END_TIME=$(date +%s)
@@ -95,11 +96,12 @@ jobs:
         uses: actions/checkout at v2
       - name: Build test environment
         run: |
-          docker run --detach --name rtdb --mount type=tmpfs,destination=/var/lib/postgresql/data --env POSTGRES_PASSWORD=password postgres:9.6
-          docker build --build-arg RT_DB_TYPE=Pg --build-arg RT_TEST_DB_HOST=rtdb --tag rtir .
+          docker network create rt
+          docker run --detach --name rtdb --network rt --mount type=tmpfs,destination=/var/lib/postgresql/data --env POSTGRES_PASSWORD=password postgres:9.6
+          docker build --build-arg RT_DB_TYPE=Pg --build-arg RT_TEST_DB_HOST=rtdb --network rt --tag rtir .
       - name: Run RTIR tests
         run: |
-          docker run --volume "$GITHUB_WORKSPACE:/rtir" rtir bash -c 'cd /rtir && perl Makefile.PL && make test-parallel'
+          docker run --network rt --volume "$GITHUB_WORKSPACE:/rtir" rtir bash -c 'cd /rtir && perl Makefile.PL && make test-parallel'
       - name: Get run time
         run: |
           RT_GA_END_TIME=$(date +%s)

-- 
To stop receiving notification emails like this one, please contact
sysadmin at bestpractical.com.


More information about the rt-commit mailing list