Update docker/build-push-action action to v6 #6004
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: Backend | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
DATABASE_URL: "root:password@tcp(mysql)/?parseTime=true&multiStatements=true" | |
SMTP_SERVER: ${{secrets.SMTP_SERVER}} | |
SMTP_PORT: "587" | |
SMTP_USERNAME: ${{secrets.SMTP_USERNAME}} | |
SMTP_PASSWORD: ${{secrets.SMTP_PASSWORD}} | |
SMTP_FROM: ${{secrets.SMTP_FROM}} | |
TEST_EMAIL_TO: ${{secrets.TEST_EMAIL_TO}} | |
jobs: | |
backend-ci: | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mariadb:11.3 | |
options: --health-cmd "mariadb-admin ping -h localhost" --health-interval 20s --health-timeout 10s --health-retries 10 | |
env: | |
MYSQL_ROOT_PASSWORD: password | |
MYSQL_DATABASE: database | |
container: | |
image: golang:1.22 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install mysqldef | |
run: | | |
curl -fsSL https://github.com/k0kubun/sqldef/releases/download/v0.16.7/mysqldef_linux_amd64.tar.gz -o ./mysqldef.tar.gz | |
tar xvf mysqldef.tar.gz -C /usr/local/bin | |
chmod +x /usr/local/bin/mysqldef | |
rm -f ./mysqldef.tar.gz | |
- name: Download modules | |
working-directory: backend | |
run: go mod download | |
- name: Coverage | |
working-directory: backend | |
run: go test -v -race -cover -tags use_external_db -coverprofile=coverage ./... | |
- name: Report likely mistakes | |
working-directory: backend | |
run: go vet ./... | |
# - name: Staticcheck | |
# working-directory: backend | |
# run: go install honnef.co/go/tools/cmd/staticcheck@latest && staticcheck ./... | |
- name: Build | |
working-directory: backend | |
run: CGO_ENABLED=0 go build -buildmode pie -buildvcs=false | |
- name: Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./backend/coverage | |
flags: backend | |
name: codecov-backend | |
fail_ci_if_error: false | |
verbose: true |