64 lines
2.4 KiB
YAML
64 lines
2.4 KiB
YAML
on: push
|
|
name: Run acceptance tests
|
|
|
|
jobs:
|
|
test-output-linux:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Launch 1Password Connect instance
|
|
env:
|
|
OP_CONNECT_CREDENTIALS: ${{ secrets.OP_CONNECT_CREDENTIALS }}
|
|
run: |
|
|
echo "$OP_CONNECT_CREDENTIALS" > 1password-credentials.json
|
|
docker-compose -f tests/fixtures/docker-compose.yml up -d && sleep 10
|
|
- name: Configure 1Password Connect
|
|
uses: ./configure # 1password/load-secrets-action/configure@<version>
|
|
with:
|
|
connect-host: http://localhost:8080
|
|
connect-token: ${{ secrets.OP_CONNECT_TOKEN }}
|
|
- name: Load secrets
|
|
id: load_secrets
|
|
uses: ./ # 1password/load-secrets-action@<version>
|
|
with:
|
|
export-env: true
|
|
env:
|
|
SECRET: op://acceptance-tests/test-secret/password
|
|
SECRET_IN_SECTION: op://acceptance-tests/test-secret/test-section/password
|
|
MULTILINE_SECRET: op://acceptance-tests/multiline-secret/notesPlain
|
|
- name: Assert test secret values
|
|
run: ./tests/assert-env-set.sh
|
|
test-export-linux:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Launch 1Password Connect instance
|
|
env:
|
|
OP_CONNECT_CREDENTIALS: ${{ secrets.OP_CONNECT_CREDENTIALS }}
|
|
run: |
|
|
echo "$OP_CONNECT_CREDENTIALS" > 1password-credentials.json
|
|
docker-compose -f tests/fixtures/docker-compose.yml up -d && sleep 10
|
|
- name: Configure 1Password Connect
|
|
uses: ./configure # 1password/load-secrets-action/configure@<version>
|
|
with:
|
|
connect-host: http://localhost:8080
|
|
connect-token: ${{ secrets.OP_CONNECT_TOKEN }}
|
|
- name: Load secrets
|
|
uses: ./ # 1password/load-secrets-action@<version>
|
|
with:
|
|
export-env: true
|
|
env:
|
|
SECRET: op://acceptance-tests/test-secret/password
|
|
SECRET_IN_SECTION: op://acceptance-tests/test-secret/test-section/password
|
|
MULTILINE_SECRET: op://acceptance-tests/multiline-secret/notesPlain
|
|
- name: Print environment variables with masked secrets
|
|
run: printenv
|
|
- name: Assert test secret values
|
|
run: ./tests/assert-env-set.sh
|
|
- name: Remove secrets
|
|
uses: ./ # 1password/load-secrets-action@<version>
|
|
with:
|
|
unset-previous: true
|
|
- name: Assert removed secrets
|
|
run: ./tests/assert-env-unset.sh
|