change the docker image #605
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 & Publish Docker Image | |
on: | |
push: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
go: [ 'stable', 'oldstable' ] | |
services: | |
rabbitmq-streaming: | |
image: pivotalrabbitmq/rabbitmq-stream | |
env: | |
RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS: "-rabbitmq_stream advertised_host localhost" | |
ports: | |
- 5552:5552 | |
- 15672:15672 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
id: setup_go | |
with: | |
go-version: ${{ matrix.go }} | |
check-latest: true | |
- run: make test GO_VERSION=${{ steps.setup_go.outputs.go-version }} | |
- name: Upload code coverage to Codecov | |
run: bash <(curl -s https://codecov.io/bash) | |
test-win32: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
go: [ 'stable', 'oldstable' ] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
id: setup_go | |
with: | |
go-version: ${{ matrix.go }} | |
check-latest: true | |
- name: Cache installers | |
uses: actions/cache@v3 | |
with: | |
# Note: the cache path is relative to the workspace directory | |
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#using-the-cache-action | |
path: ~/installers | |
key: ${{ runner.os }}-v0-${{ hashFiles('.ci/versions.json') }} | |
- name: Install and start RabbitMQ | |
run: ./.ci/install.ps1 | |
- name: Install GNU make | |
run: choco install make | |
- run: make test GO_VERSION=${{ steps.setup_go.outputs.go-version }} | |
publish: | |
runs-on: ubuntu-latest | |
needs: [test, test-win32] | |
steps: | |
- uses: docker/setup-buildx-action@v2 | |
- uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- uses: actions/checkout@v3 | |
- name: Publish Docker Image | |
run: | | |
set -x | |
VERSION=latest | |
export VERSION | |
if [[ ! $GITHUB_REF =~ "/tags/" ]] | |
then | |
VERSION=dev | |
fi | |
make perf-test-docker-push |