Skip to content

Add GitHub Actions workflow to run tests on pull requests #2

Add GitHub Actions workflow to run tests on pull requests

Add GitHub Actions workflow to run tests on pull requests #2

Workflow file for this run

name: Tests
on:
pull_request:
branches: ['*']
jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run unit tests
run: bash tests/test_update_pr_stack.sh
e2e-tests:
name: E2E Tests
runs-on: ubuntu-latest
# Only run if secrets are available (not available on forks)
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Generate GitHub App token
id: app-token
env:
GH_APP_ID: ${{ secrets.GH_APP_ID }}
GH_APP_PRIVATE_KEY_PEM_B64: ${{ secrets.GH_APP_PRIVATE_KEY_PEM_B64 }}
run: |
TOKEN=$(uv run .claude/get_github_app_token.py)
echo "::add-mask::$TOKEN"
echo "token=$TOKEN" >> "$GITHUB_OUTPUT"
- name: Setup gh authentication
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: gh auth setup-git
- name: Run e2e tests
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: bash tests/test_e2e.sh