Unverified Commit d512fea3 authored by Fedor Batonogov's avatar Fedor Batonogov Committed by GitHub
Browse files

Test images before push in registry (#4)

Now images testing before push to registry.  
parent bcceaa6d
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -9,7 +9,19 @@ env:
  DOCKERFILE: Dockerfile-py3-amd64

jobs:

  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repo
        uses: actions/checkout@v3
      - name: Run Tests
        run: |
          echo "Building image to test"
          ./build-and-test.sh ${{ env.DOCKERFILE }}

  build_and_push_to_registry:
    needs: test
    name: Push Docker image to Docker Hub
    runs-on: ubuntu-latest
    steps:
+12 −0
Original line number Diff line number Diff line
@@ -9,7 +9,19 @@ env:
  DOCKERFILE: Dockerfile-py3-win64

jobs:

  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repo
        uses: actions/checkout@v3
      - name: Run Tests
        run: |
          echo "Building image to test"
          ./build-and-test.sh ${{ env.DOCKERFILE }}

  build_and_push_to_registry:
    needs: test
    name: Push Docker image to Docker Hub
    runs-on: ubuntu-latest
    steps:
+0 −2
Original line number Diff line number Diff line
@@ -162,5 +162,3 @@ cython_debug/
# Other
.DS_Store
.fleet
act.sh
test/

build-and-test.sh

0 → 100755
+9 −0
Original line number Diff line number Diff line
#!/bin/bash

if [ -z $1 ];
then
    echo "Enter dockerfile name"
else
    docker build -f $1 -t test_image . && \
    docker run -v "$(pwd)/test:/src/" test_image "pyinstaller main.py"
fi

test/main.py

0 → 100644
+4 −0
Original line number Diff line number Diff line
import requests

get = requests.get('https://api.github.com')
print(get)
Loading