123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- # This workflow will build a golang project
- # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
- name: Go
- on:
- push:
- branches: [ "main" ]
- pull_request:
- branches: [ "main" ]
- permissions:
- id-token: write
- contents: read
- jobs:
- build:
- runs-on: ubuntu-latest
- services:
- postgres:
- image: postgres
- env:
- POSTGRES_PASSWORD: postgres
- POSTGRES_USER: postgres
- POSTGRES_DB: postgres
- options: >-
- --health-cmd pg_isready
- --health-interval 10s
- --health-timeout 5s
- --health-retries 5
- ports:
- - 5432:5432
- steps:
- - uses: actions/checkout@v3
- - name: Set up Go
- uses: actions/setup-go@v3
- with:
- go-version-file: 'go.mod'
- cache: true
- - name: Install dependencies
- run: |
- sudo apt-get update
- sudo apt-get -y install libvips-dev
- - name: Configure AWS credentials
- uses: aws-actions/configure-aws-credentials@v2
- with:
- aws-region: ap-northeast-1
- role-to-assume: arn:aws:iam::475867236237:role/qor5-test-example-ci-github-actions-upload-assets
- - name: Build
- run: go build -v ./...
- - name: Test
- run: go test -v -p=1 -count=1 ./...
- env:
- DBURL: "postgres://postgres:postgres@localhost:5432/postgres"
- AWS_SDK_LOAD_CONFIG: 1
- S3_Bucket: "qor5-test-example-ci"
- S3_Region: "ap-northeast-1"
|