Bump actions/setup-go from 5.1.0 to 5.3.0 #319
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: Go package | |
on: [push] | |
env: | |
CGO_ENABLED: 0 | |
GOTOOLCHAIN: local | |
MYSQL_TEST: true | |
MYSQL_TEST_USER: 'dbuser' | |
MYSQL_TEST_PASS: 'dbpass' | |
MYSQL_TEST_HOST: '127.0.0.1:3306' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set up Go | |
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 | |
with: | |
go-version-file: go.mod | |
- name: start mysql | |
uses: shogo82148/actions-setup-mysql@0355d2feddbbc87986a509528bf6f06eb5e9619d # v1.39.2 | |
with: | |
user: ${{ env.MYSQL_TEST_USER }} | |
password: ${{ env.MYSQL_TEST_PASS }} | |
- name: create database | |
run: | | |
mysql --user 'root' --host '127.0.0.1' -e 'create database certs;' | |
- name: Run tests | |
run: make test | |
- name: Build | |
run: make | |
docker_image: | |
needs: build | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 | |
- name: Login to Docker Hub | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
# TODO: change this | |
nsheridan/cashier | |
# Docker tags based on the following events/attributes | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=sha | |
type=raw,value=latest,enable={{is_default_branch}} | |
- name: Build and push | |
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |