build: protobuf bump #76
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 | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PROTOBUF_TOKEN }} | |
submodules: true | |
- name: Build Protobuf | |
run: make protobuf | |
- name: Start Containers | |
run: docker compose --file docker-compose-ci.yml up --build go_testing mongodb --wait --wait-timeout 30 | |
- name: Run Tests | |
run: docker compose exec go_testing go test -v ./... | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Format | |
run: go fmt ./... | |
vet: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PROTOBUF_TOKEN }} | |
submodules: true | |
- name: Build Protobuf | |
run: make protobuf | |
- name: Vet | |
run: go vet ./... | |
test-production: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PROTOBUF_TOKEN }} | |
submodules: true | |
- name: Copy env file | |
run: cp .env.dev.example .env | |
- name: Build Protobuf | |
run: make protobuf | |
- name: Test Production Container | |
run: docker compose --file docker-compose-ci.yml up --build production mongodb --wait --wait-timeout 30 | |
tag-production: | |
runs-on: ubuntu-latest | |
needs: [test, format, vet, test-production] | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PROTOBUF_TOKEN }} | |
submodules: true | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build Protobuf | |
run: make protobuf | |
- name: Build and Tag Production | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/amd64, linux/arm64 | |
file: Dockerfile | |
push: true | |
target: production | |
build-args: | | |
GO_VERSION=1.21 | |
tags: | | |
andytwf/ecfmp-flow:discord-latest |