Skip to content

chore: update modules #221

chore: update modules

chore: update modules #221

Workflow file for this run

name: Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:alpine
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: forest
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379
steps:
- name: Forest test
uses: actions/setup-go@v2
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get dependencies
run:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin latest
- name: Install
run: make install
- name: Generate
run: make generate
- name: Lint
run: make lint
- name: Test
run: make test
env:
GO_ENV: test
DATABASE_URI: postgres://postgres:[email protected]:5432/postgres
REDIS_URI: redis://127.0.0.1:6379/?slow=200ms&maxProcessing=1000
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: vicanso/forest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}