diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index c15fb3ac..2243f1ae 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -27,7 +27,21 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - run: docker build . --tag ${{ env.IMAGE_NAME }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + tags: ${{ IMAGE_NAME }} + outputs: type=docker,dest=/tmp/${{ env.IMAGE_NAME }}.tar + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ IMAGE_NAME }} + path: /tmp/${{ env.IMAGE_NAME }}.tar test: @@ -35,8 +49,18 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - run: docker build . --tag ${{ env.IMAGE_NAME }} - - run: docker run ${{ env.IMAGE_NAME }} test + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Download artifact + uses: actions/download-artifact@v2 + with: + name: ${{ IMAGE_NAME }} + path: /tmp + - name: Load Docker image + run: | + docker load --input /tmp/${{ env.IMAGE_NAME }}.tar + docker run ${{ env.IMAGE_NAME }} test publish-coverage: @@ -45,29 +69,39 @@ jobs: # upload coverage report steps: - uses: actions/checkout@v2 - - run: docker build . --tag ${{ env.IMAGE_NAME }} - - name: Codecov - uses: codecov/codecov-action@v1.0.12 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Download artifact + uses: actions/download-artifact@v2 with: - # User defined upload name. Visible in Codecov UI - name: # optional - # Repository upload token - get it from codecov.io. Required only for private repositories - token: # optional - # Path to coverage file to upload - file: # optional - # Comma-separated list of files to upload - files: # optional - # Directory to search for coverage reports. - directory: # optional - # Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome) - flags: # optional - # Write upload file to path before uploading - path_to_write_report: # optional - # Environment variables to tag the upload with (e.g. PYTHON | OS,PYTHON) - env_vars: # optional - # Specify whether or not CI build should fail if Codecov runs into an error during upload - fail_ci_if_error: # optional + name: ${{ IMAGE_NAME }} + path: /tmp + - name: Load Docker image + run: | + docker load --input /tmp/${{ env.IMAGE_NAME }}.tar + +# - name: Codecov +# uses: codecov/codecov-action@v1.0.12 +# with: +# # User defined upload name. Visible in Codecov UI +# name: # optional +# # Repository upload token - get it from codecov.io. Required only for private repositories +# token: # optional +# # Path to coverage file to upload +# file: # optional +# # Comma-separated list of files to upload +# files: # optional +# # Directory to search for coverage reports. +# directory: # optional +# # Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome) +# flags: # optional +# # Write upload file to path before uploading +# path_to_write_report: # optional +# # Environment variables to tag the upload with (e.g. PYTHON | OS,PYTHON) +# env_vars: # optional +# # Specify whether or not CI build should fail if Codecov runs into an error during upload +# fail_ci_if_error: # optional publish-pypi: @@ -75,7 +109,18 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - run: docker run ${{ env.IMAGE_NAME }} upload + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Download artifact + uses: actions/download-artifact@v2 + with: + name: ${{ IMAGE_NAME }} + path: /tmp + - name: Load Docker image + run: | + docker load --input /tmp/${{ env.IMAGE_NAME }}.tar + docker run ${{ env.IMAGE_NAME }} upload publish-docker: