Original should be attributed to correct author #13
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: Automated API tests using Postman CLI | |
on: pull_request | |
jobs: | |
automated-api-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Postman CLI | |
run: | | |
curl -o- "https://dl-cli.pstmn.io/install/linux64.sh" | sh | |
- name: Login to Postman CLI | |
run: postman login --with-api-key ${{ secrets.POSTMAN_API_KEY }} | |
# wait until preview environment is ready | |
- name: Wait for preview env to be ready | |
uses: jonico/wait-for-deployment-action@v3 | |
id: deployment | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
environment: octodex-rest-api-pr-${{ github.event.pull_request.number }} | |
timeout: 60 | |
interval: 3 | |
# pass head sha of current PR to action | |
sha: ${{ github.event.pull_request.head.sha }} | |
- name: Run API tests on preview | |
run: | | |
postman collection run "${{ github.workspace }}/postman/collections/Octodex REST API.json" --integration-id "149913-${{ github.run_id }}" --env-var "baseUrl=https://octodex-rest-api-pr-${{ github.event.pull_request.number }}.herokuapp.com" |