ci: add e2e test to on-pr workflow #281
Workflow file for this run
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: Lint, Format, and Test | |
on: | |
workflow_call: | |
workflow_dispatch: | |
pull_request: | |
env: | |
API_KEY: ${{ secrets.API_KEY }} | |
APP_ID: ${{ secrets.APP_ID }} | |
PSG_JWT: ${{ secrets.PSG_JWT }} | |
TEST_USER_ID: ${{ secrets.TEST_USER_ID }} | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
- name: Install Rubocop | |
run: gem install rubocop | |
- name: Lint | |
run: rubocop -l | |
format: | |
name: Format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
- name: Install Rubocop | |
run: gem install rubocop | |
- name: Format | |
run: rubocop --format github | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
- name: Install dependencies | |
run: bundle install | |
- name: Test | |
run: ruby tests/all.rb | |
test-e2e: | |
name: Test E2E | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions-cool/check-user-permission@v2 | |
with: | |
require: write | |
id: check_permission | |
- name: Trigger E2E Workflow in backend-sdk-tests and Wait | |
if: ${{ steps.check_permission.outputs.require-result == 'true' }} | |
uses: convictional/[email protected] | |
with: | |
owner: passageidentity | |
repo: backend-sdk-tests | |
workflow_file_name: integration-tests-complete.yml | |
github_token: ${{ secrets.BE_SDK_PAT }} | |
# github.head_ref is only available on PR events, while github.ref_name provides the branch name on other events | |
client_payload: >- | |
{ | |
"target_sdk":"ruby", | |
"use_test_release":true, | |
"sdk_branch_ref":"${{ github.head_ref || github.ref_name }}" | |
} |