Move CI test into its own script. #127
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: pull_request | |
jobs: | |
go-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21.x | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Run linters | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: latest | |
args: --timeout=3m | |
go-test: | |
strategy: | |
matrix: | |
go-version: [1.21.x] | |
platform: [ubuntu-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Install Go | |
if: success() | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: go tests | |
run: go test -v -covermode=count -json ./... > test.json | |
- name: annotate go tests | |
if: always() | |
uses: guyarb/[email protected] | |
with: | |
test-results: test.json | |
test: | |
runs-on: ubuntu-latest | |
env: | |
BATON_GLOBAL_AWS_SSO_ENABLED: true | |
BATON_GLOBAL_AWS_ORGS_ENABLED: true | |
BATON_GLOBAL_AWS_SSO_REGION: us-east-1 | |
BATON_GLOBAL_REGION: us-east-1 | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.x | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build baton-aws | |
run: go build ./cmd/baton-aws | |
- name: Run baton-aws | |
env: | |
BATON_GLOBAL_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
BATON_GLOBAL_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
run: ./baton-aws | |
- name: Checkout baton | |
uses: actions/checkout@v4 | |
with: | |
repository: ConductorOne/baton | |
ref: main | |
path: ./baton | |
- name: Build baton | |
working-directory: ./baton | |
run: go build ./cmd/baton | |
- name: Test grant/revoking IAM entitlements | |
env: | |
BATON: ./baton/baton | |
BATON_AWS: ./baton-aws | |
BATON_GLOBAL_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
BATON_GLOBAL_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
BATON_ENTITLEMENT: "group:arn:aws:iam::737118012813:group/ci-test-group:member" | |
BATON_PRINCIPAL: "arn:aws:iam::737118012813:user/ci-test-user" | |
BATON_PRINCIPAL_TYPE: "iam_user" | |
BATON_GRANT: "group:arn:aws:iam::737118012813:group/ci-test-group:member:iam_user:arn:aws:iam::737118012813:user/ci-test-user" | |
run: ./test/grant-revoke.sh | |
- name: Test grant/revoking SSO entitlements | |
env: | |
BATON: ./baton/baton | |
BATON_AWS: ./baton-aws | |
BATON_GLOBAL_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
BATON_GLOBAL_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
BATON_ENTITLEMENT: "sso_group:arn:aws:identitystore:us-east-1::d-90679d1878/group/9458d408-40b1-709f-4f45-92be754928e5:member" | |
BATON_PRINCIPAL: "arn:aws:identitystore:us-east-1::d-90679d1878/user/54982488-f0d1-70c1-1dd5-6db47f7add45" | |
BATON_PRINCIPAL_TYPE: "sso_user" | |
BATON_GRANT: "8418c428-1061-70cc-01da-b38b652ab0e6" | |
run: ./test/grant-revoke.sh |