Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 153 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
name: CI

on:
push:
branches: [master, v1]
pull_request:
branches: [master, v1]

jobs:
test:
name: Unit Tests
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["stable"]

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
cache: true

- name: Download dependencies
run: go mod download

- name: Verify dependencies
run: go mod verify

- name: Run unit tests
run: go test -count=1 -v -race -coverprofile=coverage.out -covermode=atomic ./...

- name: Upload coverage
uses: codecov/codecov-action@v4
with:
files: coverage.out
fail_ci_if_error: false

integration-test:
name: Integration Tests
runs-on: ubuntu-latest

services:
localstack:
image: localstack/localstack:latest
ports:
- 4566:4566
- 4510-4559:4510-4559
env:
SERVICES: s3,dynamodb,sqs,secretsmanager,ssm,lambda
DEBUG: 0
PERSISTENCE: 0
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
options: >-
--health-cmd "curl -f http://localhost:4566/_localstack/health"
--health-interval 5s
--health-timeout 5s
--health-retries 10
--health-start-period 10s

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: "stable"
cache: true

- name: Download dependencies
run: go mod download

- name: Wait for LocalStack to be ready
run: |
echo "Waiting for LocalStack to be healthy..."
for i in {1..30}; do
if curl -s http://localhost:4566/_localstack/health | grep -q '"s3": "available"'; then
echo "LocalStack is ready!"
break
fi
echo "Waiting for LocalStack... (attempt $i)"
sleep 2
done
# Show LocalStack health status
curl -s http://localhost:4566/_localstack/health | jq .

- name: Run integration tests
env:
LOCALSTACK_ENDPOINT: http://localhost:4566
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_DEFAULT_REGION: us-east-1
run: |
go test -count=1 -v -race -tags=integration -coverprofile=integration-coverage.out -covermode=atomic ./aws/...

- name: Upload integration coverage
uses: codecov/codecov-action@v4
with:
files: integration-coverage.out
flags: integration
fail_ci_if_error: false

lint:
name: Lint
runs-on: ubuntu-latest
continue-on-error: true

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: "stable"
cache: true

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout=5m
continue-on-error: true

benchmark:
name: Benchmark
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: "stable"
cache: true

- name: Run benchmarks
run: go test -bench=. -benchmem ./... | tee benchmark.txt

- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: benchmark.txt
68 changes: 58 additions & 10 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,72 @@
name: Go
on: [ push ]
jobs:

on:
push:
branches: [master, v1]

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:

- name: Check out code into the Go module directory
uses: actions/checkout@v5
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up Go 1.22.1
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: '>=1.25.2'
go-version: "stable"
cache: true
id: go

- name: Build
run: go build -v .
run: go build -v ./...

- name: Test
run: go test -race `go list ./... | grep -v "aws\|sftp\|http"`
run: go test -count=1 -race -v ./...

lint:
name: Lint
runs-on: ubuntu-latest
continue-on-error: true

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: "stable"
cache: true

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout=5m
continue-on-error: true

benchmark:
name: Benchmark
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: "stable"
cache: true

- name: Run benchmarks
run: go test -bench=. -benchmem ./... | tee benchmark.txt

- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: benchmark.txt
22 changes: 0 additions & 22 deletions .gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
linters:
default: all
version: '2'
version: "2"
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ event. Representation of a project may be further defined and clarified by proje
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at
savialessiobtc@gmail.com. All complaints will be reviewed and investigated and will result in a response that is deemed
<alessiosavibtc@gmail.com>. All complaints will be reviewed and investigated and will result in a response that is deemed
necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to
the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Expand All @@ -54,9 +54,9 @@ repercussions as determined by other members of the project's leadership.
## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available
at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
<https://www.contributor-covenant.org/faq>
Loading
Loading