chore: add private repo tests on pr #3
Workflow file for this run
This file contains hidden or 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: Private Repo Testing | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: 'private-test-${{ github.event.pull_request.number }}' | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| trigger-private-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Set up Node.js for UI build | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - name: Install UI dependencies | |
| run: pnpm install | |
| - name: Build UI | |
| run: pnpm --prefix web/client run build | |
| - name: Install Python dependencies | |
| run: | | |
| python -m venv .venv | |
| source .venv/bin/activate | |
| pip install build twine setuptools_scm | |
| - name: Generate development version | |
| id: version | |
| run: | | |
| source .venv/bin/activate | |
| # Generate a unique version for every commit/build | |
| BASE_VERSION=$(python .github/scripts/get_scm_version.py) | |
| COMMIT_SHA=$(git rev-parse --short HEAD) | |
| UNIQUE_VERSION="${BASE_VERSION}.pr${{ github.event.pull_request.number }}.${COMMIT_SHA}" | |
| echo "version=$UNIQUE_VERSION" >> $GITHUB_OUTPUT | |
| echo "Generated unique development version: $UNIQUE_VERSION" | |
| - name: Build package | |
| env: | |
| SETUPTOOLS_SCM_PRETEND_VERSION: ${{ steps.version.outputs.version }} | |
| run: | | |
| source .venv/bin/activate | |
| python -m build | |
| - name: Configure PyPI for private repository | |
| env: | |
| TOBIKO_PRIVATE_PYPI_URL: ${{ secrets.TOBIKO_PRIVATE_PYPI_URL }} | |
| TOBIKO_PRIVATE_PYPI_KEY: ${{ secrets.TOBIKO_PRIVATE_PYPI_KEY }} | |
| run: ./.circleci/update-pypirc.sh | |
| - name: Publish to private PyPI | |
| run: | | |
| source .venv/bin/activate | |
| python -m twine upload -r tobiko-private dist/* | |
| - name: Get commit information | |
| id: commit | |
| run: | | |
| echo "author=$(git log -1 --format='%an')" >> $GITHUB_OUTPUT | |
| echo "hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
| echo "message=$(git log -1 --format='%s')" >> $GITHUB_OUTPUT | |
| - name: Get GitHub App token | |
| id: get_token | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| private-key: ${{ secrets.TOBIKO_RENOVATE_BOT_PRIVATE_KEY }} | |
| app-id: ${{ secrets.TOBIKO_RENOVATE_BOT_APP_ID }} | |
| owner: ${{ secrets.PRIVATE_REPO_OWNER }} | |
| - name: Trigger private repository workflow | |
| uses: convictional/trigger-workflow-and-wait@v1.6.5 | |
| with: | |
| owner: ${{ secrets.PRIVATE_REPO_OWNER }} | |
| repo: ${{ secrets.PRIVATE_REPO_NAME }} | |
| github_token: ${{ steps.get_token.outputs.token }} | |
| workflow_file_name: ${{ secrets.PRIVATE_WORKFLOW_FILE }} | |
| client_payload: | | |
| { | |
| "package_version": "${{ steps.version.outputs.version }}", | |
| "python_version": "3.12", | |
| "author": "${{ steps.commit.outputs.author }}", | |
| "hash": "${{ steps.commit.outputs.hash }}", | |
| "message": "${{ steps.commit.outputs.message }}", | |
| "pr_number": "${{ github.event.pull_request.number }}" | |
| } |