Skip to content

Re authenticate with common fate during registry sync if token is exp… #1535

Re authenticate with common fate during registry sync if token is exp…

Re authenticate with common fate during registry sync if token is exp… #1535

Workflow file for this run

name: CI
on: [push]
jobs:
test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
- uses: actions/cache@v2
with:
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
# * Build cache (Windows)
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "1.22.1"
- name: Build All Platforms
run: make ci-cli-all-platforms
# Upload the built binaries to use in later tests on each platform
- uses: actions/upload-artifact@v3
with:
name: go-binaries-linux
path: ./bin/linux/
- uses: actions/upload-artifact@v3
with:
name: go-binaries-macos
path: ./bin/macos/
- uses: actions/upload-artifact@v3
with:
name: go-binaries-windows
path: ./bin/windows/
- name: Lint
run: go vet ./...
- name: Test
run: go test ./...
golangci-lint:
name: Go Lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.22.1
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
timeout-minutes: 5
with:
version: latest
args: --timeout 5m
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@94e0aab03ca135d11a35e5bfc14e6746dc56e7e9
# linux-installs:
# needs: test
# name: Smoke Test (Linux)
# env:
# TEST_ACCESS_KEY_ID: 1234578910abcdefghij
# TEST_ACCESS_KEY: 1234578910abcdefghijklmnopqrstuvwxyz1234
# TEST_REGION: ap-southeast-2
# runs-on: ubuntu-latest
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: go-binaries-linux
# - name: move binaries
# run: |
# chmod +x ./dassumego && mv ./dassumego /usr/local/bin/
# chmod +x ./dgranted && mv ./dgranted /usr/local/bin/
# chmod +x ./tbrowser && mv ./tbrowser /usr/local/bin/
# chmod +x ./tcreds && mv ./tcreds /usr/local/bin/
# chmod +x ./dassume && mv ./dassume /usr/local/bin/
# chmod +x ./dassume.fish && mv ./dassume.fish /usr/local/bin/
# - name: set default browser
# # configures granted to use the test browser binary
# run: dgranted browser set -b chrome -p /usr/local/bin/tbrowser
# - name: setup aws config files
# run: mkdir ~/.aws; touch ~/.aws/config; touch ~/.aws/credentials;
# - name: setup fake aws profile
# run: |
# cat << EOF >> ~/.aws/config
# [profile test]
# region = ${TEST_REGION}
# EOF
# - name: setup fake aws profile credentials
# run: |
# cat << EOF >> ~/.aws/credentials
# [test]
# aws_access_key_id=${TEST_ACCESS_KEY_ID}
# aws_secret_access_key=${TEST_ACCESS_KEY}
# EOF
# - name: bash
# run: dassume -auto-configure-shell
# # it seems not possible to reload the bash_profile in github actions here, so we will have to skip this test
# # the below does not work
# # - name: assume bash
# # run: |
# # source ~/.bash_profile
# # bash dassume test
# # ./bin/tcreds -aws-access-key-id $TEST_ACCESS_KEY_ID -aws-secret-key $TEST_ACCESS_KEY -aws-region $TEST_REGION
# # shell: bash
# - name: Install zsh
# run: sudo apt-get update; sudo apt-get install zsh
# - name: zsh
# run: dassume -auto-configure-shell
# shell: zsh {0}
# - name: assume zsh
# run: |
# dassume test
# tcreds -aws-access-key-id $TEST_ACCESS_KEY_ID -aws-secret-key $TEST_ACCESS_KEY -aws-region $TEST_REGION
# shell: zsh {0}
# - name: install fish
# run: sudo apt-add-repository ppa:fish-shell/release-3; sudo apt update; sudo apt install fish
# - name: fish
# run: SHELL=fish dassume -auto-configure-shell
# shell: fish {0}
# - name: assume zsh
# run: |
# SHELL=fish dassume test
# tcreds -aws-access-key-id $TEST_ACCESS_KEY_ID -aws-secret-key $TEST_ACCESS_KEY -aws-region $TEST_REGION
# shell: fish {0}
# osx-installs:
# needs: test
# name: Smoke Test (MacOS)
# runs-on: macos-11
# env:
# TEST_ACCESS_KEY_ID: 1234578910abcdefghij
# TEST_ACCESS_KEY: 1234578910abcdefghijklmnopqrstuvwxyz1234
# TEST_REGION: ap-southeast-2
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: go-binaries-macos
# - name: move binaries
# run: |
# chmod +x ./dassumego && mv ./dassumego /usr/local/bin/
# chmod +x ./dgranted && mv ./dgranted /usr/local/bin/
# chmod +x ./tbrowser && mv ./tbrowser /usr/local/bin/
# chmod +x ./tcreds && mv ./tcreds /usr/local/bin/
# chmod +x ./dassume && mv ./dassume /usr/local/bin/
# chmod +x ./dassume.fish && mv ./dassume.fish /usr/local/bin/
# - name: set default browser
# # configures granted to use the test browser binary
# run: dgranted browser set -b chrome -p /usr/local/bin/tbrowser
# - name: setup aws config files
# run: mkdir ~/.aws; touch ~/.aws/config; touch ~/.aws/credentials;
# - name: setup fake aws profile
# run: |
# cat << EOF >> ~/.aws/config
# [profile test]
# region = ${TEST_REGION}
# EOF
# - name: setup fake aws profile credentials
# run: |
# cat << EOF >> ~/.aws/credentials
# [test]
# aws_access_key_id=${TEST_ACCESS_KEY_ID}
# aws_secret_access_key=${TEST_ACCESS_KEY}
# EOF
# - name: bash
# run: dassume -auto-configure-shell
# shell: bash {0}
# # bash doesn't work in github actions
# # - name: assume bash
# # run: |
# # dassume test
# # ./bin/tcreds -aws-access-key-id $TEST_ACCESS_KEY_ID -aws-secret-key $TEST_ACCESS_KEY -aws-region $TEST_REGION
# # shell: bash -l {0}
# - name: zsh
# run: dassume -auto-configure-shell
# shell: zsh {0}
# - name: assume zsh
# run: |
# dassume test
# /usr/local/bin/tcreds -aws-access-key-id $TEST_ACCESS_KEY_ID -aws-secret-key $TEST_ACCESS_KEY -aws-region $TEST_REGION
# shell: zsh {0}
# - name: install fish
# run: brew install fish
# - name: fish
# run: dassume -auto-configure-shell
# shell: fish {0}
# - name: assume fish
# run: |
# dassume test
# tcreds -aws-access-key-id $TEST_ACCESS_KEY_ID -aws-secret-key $TEST_ACCESS_KEY -aws-region $TEST_REGION
# shell: fish {0}