Skip to content

update CI

update CI #3

Workflow file for this run

name: TinyURL CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
name: Test
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: 123
POSTGRES_DB: tinyurl_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.3'
- name: Install dependencies
working-directory: ./tinyURL
run: go mod download
- name: Run integration tests
working-directory: ./tinyURL
run: go test ./tests/ -v
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Gos
uses: actions/setup-go@v4
with:
go-version: '1.22.3'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
working-directory: ./tinyURL
build:
name: Build
runs-on: ubuntu-latest
needs: [test, lint]
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.3'
- name: Build
working-directory: ./tinyURL
run: go build -v ./...