Skip to content

Merge pull request #254 from 88labs/feat/s3-download-use-pooled-buffe… #315

Merge pull request #254 from 88labs/feat/s3-download-use-pooled-buffe…

Merge pull request #254 from 88labs/feat/s3-download-use-pooled-buffe… #315

Workflow file for this run

name: Test AWS
on:
push:
branches:
- main
paths:
- "aws/**"
pull_request:
types:
- opened
- synchronize
- reopened
paths:
- "aws/**"
env:
testdir : ./aws
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Cache Go modules
id: cache-go
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Go modules
working-directory: ${{ env.testdir }}
shell: bash
if: ${{ steps.cache-go.outputs.cache-hit != 'true' }}
run: go mod download
- name: Setup Docker
working-directory: ${{ env.testdir }}
env:
DOCKER_BUILDKIT: 1
run: |
# Create the directory for the volume of dynamodb in advance, otherwise permission error will occur.
# https://stackoverflow.com/questions/45850688/unable-to-open-local-dynamodb-database-file-after-power-outage
mkdir -p ./docker/dynamodb/data
sudo chmod 777 ./docker/dynamodb/data
docker compose up -d
- name: Test
working-directory: ${{ env.testdir }}
run: |
# shellcheck disable=SC2046
go test -p 4 -parallel 4 -v ./... -race -coverprofile="coverage.txt" -covermode=atomic -coverpkg=./...
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ env.testdir }}/coverage.txt