Functional tests #573
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: Functional tests | |
on: | |
workflow_run: | |
workflows: ['Build binary'] | |
types: | |
- completed | |
env: | |
GOLANG_VERSION: '1.20.x' | |
jobs: | |
functional_tests: | |
name: Run functional tests | |
runs-on: ${{ matrix.os }} | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
arch: ['amd64', 'arm64'] | |
fail-fast: true | |
steps: | |
- name: Download artifacts from the build binary workflow | |
uses: dawidd6/action-download-artifact@v3 | |
with: | |
workflow: build_binary.yml | |
workflow_conclusion: success | |
name: ${{ format('federator-{0}-{1}', runner.os, matrix.arch) }} | |
path: bin/ | |
repo: ${{github.repository}} | |
- name: Untar the artifacts and rename binary | |
run: | | |
tar -xvf ${{ format('bin/federator-{0}-{1}.tar', runner.os, matrix.arch) }} | |
mv ${{ format('bin/federator-{0}-{1}', runner.os, matrix.arch) }} bin/federator | |
- name: Run "functional tests" | |
if: ${{ matrix.arch == 'amd64' }} | |
run: | | |
./bin/federator link --role-arn ${{ secrets.ASSUME_ROLE_ARN }} | |
./bin/federator link --role-arn ${{ secrets.ASSUME_ROLE_ARN }} --region $ANOTHER_AWS_REGION | |
./bin/federator link --role-arn ${{ secrets.ASSUME_ROLE_ARN }} --json | |
./bin/federator creds --role-arn ${{ secrets.ASSUME_ROLE_ARN }} | |
./bin/federator creds --role-arn ${{ secrets.ASSUME_ROLE_ARN }} --region $ANOTHER_AWS_REGION | |
./bin/federator creds --role-arn ${{ secrets.ASSUME_ROLE_ARN }} --json | |
./bin/federator creds --role-arn ${{ secrets.ASSUME_ROLE_ARN }} --awscli | |
./bin/federator trust-policy --arn arn:aws:iam::000000000000:user/myUser --external-id "test external id" | |
./bin/federator trust-policy --arn arn:aws:iam::000000000000:user/myUser --external-id "test external id" --json | |
./bin/federator trust-policy --account-id 000000000000 --external-id "test external id" | |
./bin/federator trust-policy --account-id 000000000000 --external-id "test external id" --json | |
./bin/federator --help | |
./bin/federator --version | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: 'us-west-2' | |
ANOTHER_AWS_REGION: 'us-east-2' | |
CI_MODE: true | |
- name: Rename for release | |
run: | | |
mv bin/federator ${{ format('bin/federator-{0}-{1}', runner.os, matrix.arch) }} | |
- name: Upload artifacts for the draft release workflow | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ format('federator-{0}-{1}', runner.os, matrix.arch) }} | |
path: ${{ format('bin/federator-{0}-{1}', runner.os, matrix.arch) }} |