Fix acceptance-test workflow
This commit is contained in:
15
.github/workflows/acceptance-test.yml
vendored
15
.github/workflows/acceptance-test.yml
vendored
@@ -42,6 +42,7 @@ jobs:
|
|||||||
github.event.pull_request.head.repo.full_name == github.repository
|
github.event.pull_request.head.repo.full_name == github.repository
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
- name: Fork based /ok-to-test checkout
|
- name: Fork based /ok-to-test checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -53,6 +54,7 @@ jobs:
|
|||||||
github.event.client_payload.pull_request.head.sha,
|
github.event.client_payload.pull_request.head.sha,
|
||||||
github.event.client_payload.slash_command.args.named.sha
|
github.event.client_payload.slash_command.args.named.sha
|
||||||
)
|
)
|
||||||
|
|
||||||
- name: Launch 1Password Connect instance
|
- name: Launch 1Password Connect instance
|
||||||
if: ${{ inputs.auth == 'connect' }}
|
if: ${{ inputs.auth == 'connect' }}
|
||||||
env:
|
env:
|
||||||
@@ -60,11 +62,13 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "$OP_CONNECT_CREDENTIALS" > 1password-credentials.json
|
echo "$OP_CONNECT_CREDENTIALS" > 1password-credentials.json
|
||||||
docker compose -f tests/fixtures/docker-compose.yml up -d && sleep 10
|
docker compose -f tests/fixtures/docker-compose.yml up -d && sleep 10
|
||||||
|
|
||||||
- name: Configure Service account
|
- name: Configure Service account
|
||||||
if: ${{ inputs.auth == 'service-account' }}
|
if: ${{ inputs.auth == 'service-account' }}
|
||||||
uses: ./configure
|
uses: ./configure
|
||||||
with:
|
with:
|
||||||
service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
|
service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
|
||||||
|
|
||||||
- name: Verify Service Account env var is set
|
- name: Verify Service Account env var is set
|
||||||
if: ${{ inputs.auth == 'service-account' }}
|
if: ${{ inputs.auth == 'service-account' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -73,12 +77,14 @@ jobs:
|
|||||||
echo "OP_SERVICE_ACCOUNT_TOKEN environment variable is not set" >&2
|
echo "OP_SERVICE_ACCOUNT_TOKEN environment variable is not set" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Configure 1Password Connect
|
- name: Configure 1Password Connect
|
||||||
if: ${{ inputs.auth == 'connect' }}
|
if: ${{ inputs.auth == 'connect' }}
|
||||||
uses: ./configure # 1password/load-secrets-action/configure@<version>
|
uses: ./configure # 1password/load-secrets-action/configure@<version>
|
||||||
with:
|
with:
|
||||||
connect-host: http://localhost:8080
|
connect-host: http://localhost:8080
|
||||||
connect-token: ${{ secrets.OP_CONNECT_TOKEN }}
|
connect-token: ${{ secrets.OP_CONNECT_TOKEN }}
|
||||||
|
|
||||||
- name: Verify Connect env vars are set
|
- name: Verify Connect env vars are set
|
||||||
if: ${{ inputs.auth == 'connect' }}
|
if: ${{ inputs.auth == 'connect' }}
|
||||||
run: |
|
run: |
|
||||||
@@ -86,6 +92,7 @@ jobs:
|
|||||||
echo "OP_CONNECT_HOST or OP_CONNECT_TOKEN environment variables are not set" >&2
|
echo "OP_CONNECT_HOST or OP_CONNECT_TOKEN environment variables are not set" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Load secrets
|
- name: Load secrets
|
||||||
id: load_secrets
|
id: load_secrets
|
||||||
uses: ./ # 1password/load-secrets-action@<version>
|
uses: ./ # 1password/load-secrets-action@<version>
|
||||||
@@ -97,22 +104,28 @@ jobs:
|
|||||||
SECRET_IN_SECTION: ${{ inputs.secret-in-section }}
|
SECRET_IN_SECTION: ${{ inputs.secret-in-section }}
|
||||||
MULTILINE_SECRET: ${{ inputs.multiline-secret }}
|
MULTILINE_SECRET: ${{ inputs.multiline-secret }}
|
||||||
OP_ENV_FILE: ./tests/.env.tpl
|
OP_ENV_FILE: ./tests/.env.tpl
|
||||||
|
|
||||||
- name: Assert test secret values [step output]
|
- name: Assert test secret values [step output]
|
||||||
if: ${{ !inputs.export-env }}
|
if: ${{ !inputs.export-env }}
|
||||||
env:
|
env:
|
||||||
SECRET: ${{ steps.load_secrets.outputs.SECRET }}
|
SECRET: ${{ steps.load_secrets.outputs.SECRET }}
|
||||||
SECRET_IN_SECTION: ${{ steps.load_secrets.outputs.SECRET_IN_SECTION }}
|
SECRET_IN_SECTION: ${{ steps.load_secrets.outputs.SECRET_IN_SECTION }}
|
||||||
MULTILINE_SECRET: ${{ steps.load_secrets.outputs.MULTILINE_SECRET }}
|
MULTILINE_SECRET: ${{ steps.load_secrets.outputs.MULTILINE_SECRET }}
|
||||||
OP_ENV_FILE: ./tests/.env.tpl
|
FILE_SECRET: ${{ steps.load_secrets.outputs.FILE_SECRET }}
|
||||||
|
FILE_SECRET_IN_SECTION: ${{ steps.load_secrets.outputs.FILE_SECRET_IN_SECTION }}
|
||||||
|
FILE_MULTILINE_SECRET: ${{ steps.load_secrets.outputs.FILE_MULTILINE_SECRET }}
|
||||||
run: ./tests/assert-env-set.sh
|
run: ./tests/assert-env-set.sh
|
||||||
|
|
||||||
- name: Assert test secret values [exported env]
|
- name: Assert test secret values [exported env]
|
||||||
if: ${{ inputs.export-env }}
|
if: ${{ inputs.export-env }}
|
||||||
run: ./tests/assert-env-set.sh
|
run: ./tests/assert-env-set.sh
|
||||||
|
|
||||||
- name: Remove secrets [exported env]
|
- name: Remove secrets [exported env]
|
||||||
if: ${{ inputs.export-env }}
|
if: ${{ inputs.export-env }}
|
||||||
uses: ./ # 1password/load-secrets-action@<version>
|
uses: ./ # 1password/load-secrets-action@<version>
|
||||||
with:
|
with:
|
||||||
unset-previous: true
|
unset-previous: true
|
||||||
|
|
||||||
- name: Assert removed secrets [exported env]
|
- name: Assert removed secrets [exported env]
|
||||||
if: ${{ inputs.export-env }}
|
if: ${{ inputs.export-env }}
|
||||||
run: ./tests/assert-env-unset.sh
|
run: ./tests/assert-env-unset.sh
|
||||||
|
|||||||
Reference in New Issue
Block a user