-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor GitHub Actions workflows: update token refresh condition and…
… add integration tests for GitHub client functionality
- Loading branch information
Dave Arnold
committed
May 1, 2025
1 parent
e64d7e6
commit 6f18058
Showing
4 changed files
with
157 additions
and
1 deletion.
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: GitHub Client Integration Tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ main ] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| integration-tests: | ||
| runs-on: ubuntu-latest | ||
| if: ${{ github.server_url == 'https://github.com' }} | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.9' | ||
| cache: 'pip' | ||
| cache-dependency-path: template_automation/requirements.txt | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| cd template_automation | ||
| python -m pip install --upgrade pip | ||
| pip install -r requirements.txt | ||
| - name: Run integration tests | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
| GITHUB_TOKEN_SECRET_NAME: /dev/secret/ssh/dont/tell | ||
| GITHUB_API: "https://api.github.com" # Can be overridden with vars if needed | ||
| GITHUB_ORG_NAME: ${{ github.repository_owner }} | ||
| run: | | ||
| cd template_automation | ||
| python -m pytest tests/ -v -m integration |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Integration Tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ main ] | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| GITHUB_API_URL: https://api.github.com | ||
| GITHUB_ORG: ${{ vars.TEST_GITHUB_ORG }} | ||
| GITHUB_TEST_TEAM: ${{ vars.TEST_GITHUB_TEAM }} | ||
|
|
||
| jobs: | ||
| integration-tests: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.10' | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r requirements.txt | ||
| pip install pytest pytest-cov | ||
| - name: Run integration tests | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }} | ||
| run: | | ||
| pytest tests/integration -v -m integration --cov=template_automation |