Skip to content

session: support ip location and revoke session #1977

session: support ip location and revoke session

session: support ip location and revoke session #1977

Workflow file for this run

# 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
with:
submodules: true
- 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 -coverprofile=coverage.txt -coverpkg=github.com/qor5/... ./...
env:
DBURL: "postgres://postgres:postgres@localhost:5432/postgres"
AWS_SDK_LOAD_CONFIG: 1
S3_Bucket: "qor5-test-example-ci"
S3_Region: "ap-northeast-1"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage to DeepSource
uses: deepsourcelabs/test-coverage-action@master
with:
key: go
coverage-file: coverage.txt
dsn: ${{ secrets.DEEPSOURCE_DSN }}