Skip to content

Commit

Permalink
try to run end_to_end in github action
Browse files Browse the repository at this point in the history
  • Loading branch information
ianic committed Nov 4, 2021
1 parent 001f60b commit 55fa1d4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,14 @@ jobs:
- name: Test all
working-directory:
run: go test ./...
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: AKIAQYPA52WDIKVHVTIW #${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: 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 #${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1
- name: Integration Test
working-directory: .
run: go test -v
env:
MANTIL_TESTS_AWS_PROFILE:-
17 changes: 16 additions & 1 deletion aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,32 @@ type testingI interface {
// Run tests:
// MANTIL_TESTS_AWS_PROFILE=org5 go test -v
func NewForTests(t testingI) *AWS {
const (
accessKeyIDEnv = "AWS_ACCESS_KEY_ID"
secretAccessKeyEnv = "AWS_SECRET_ACCESS_KEY"
regionEnv = "AWS_DEFAULT_REGION"
)

val, ok := os.LookupEnv(testsProfileEnv)
if !ok {
t.Logf("environment vairable %s not found", testsProfileEnv)
return nil
}
if val == "-" {
accessKeyID, _ := os.LookupEnv(accessKeyIDEnv)
secretAccessKey, _ := os.LookupEnv(secretAccessKeyEnv)
region, _ := os.LookupEnv(regionEnv)
cli, err := NewWithCredentials(accessKeyID, secretAccessKey, "", region)
if err != nil {
t.Fatal(err)
}
return cli
}
cli, err := NewFromProfile(val)
if err != nil {
t.Fatal(err)
}
return cli

}

func TestProfile() string {
Expand Down

0 comments on commit 55fa1d4

Please sign in to comment.