Skip to content

ci: add e2e test to on-pr workflow #80

ci: add e2e test to on-pr workflow

ci: add e2e test to on-pr workflow #80

name: Lint, Format, and Test
on:
workflow_call:
workflow_dispatch:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install clippy
run: rustup component add clippy
- name: Lint
run: cargo clippy --all-targets --all-features -- -D warnings
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install rustfmt
run: rustup component add rustfmt
- name: Format
run: cargo fmt --all -- --check
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --release --verbose
- name: Test
run: cargo test --release --no-fail-fast --verbose
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-flex.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":"flex-rust",
"use_test_release":true,
"sdk_branch_ref":"${{ github.head_ref || github.ref_name }}"
}
publish-check:
name: Publish Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: katyo/publish-crates@v2
with:
dry-run: true
check-repo: false
ignore-unpublished-changes: true