chore: update global workflows #564
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: CI | |
| permissions: | |
| contents: write # needed for setup-release-action | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| concurrency: | |
| group: "${{ github.workflow }}-${{ github.ref }}" | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Setup Release | |
| id: setup-release | |
| uses: LizardByte/setup-release-action@v2025.426.225 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install Python Dependencies | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel | |
| python -m pip install --upgrade -r requirements.txt | |
| python -m pip install --upgrade -r requirements-dev.txt | |
| - name: Test with pytest | |
| id: test | |
| env: | |
| CI_EVENT_ID: ${{ github.event.number || github.sha }} | |
| GITHUB_PYTEST: "true" | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_TEST_BOT_TOKEN }} | |
| DISCORD_GITHUB_STATUS_CHANNEL_ID: ${{ vars.DISCORD_GITHUB_STATUS_CHANNEL_ID }} | |
| DISCORD_REDDIT_CHANNEL_ID: ${{ vars.DISCORD_REDDIT_CHANNEL_ID }} | |
| DISCORD_SPONSORS_CHANNEL_ID: ${{ vars.DISCORD_SPONSORS_CHANNEL_ID }} | |
| GRAVATAR_EMAIL: ${{ secrets.GRAVATAR_EMAIL }} | |
| IGDB_CLIENT_ID: ${{ secrets.TWITCH_CLIENT_ID }} | |
| IGDB_CLIENT_SECRET: ${{ secrets.TWITCH_CLIENT_SECRET }} | |
| PRAW_CLIENT_ID: ${{ secrets.REDDIT_CLIENT_ID }} | |
| PRAW_CLIENT_SECRET: ${{ secrets.REDDIT_CLIENT_SECRET }} | |
| REDDIT_USERNAME: ${{ secrets.REDDIT_USERNAME }} | |
| REDDIT_PASSWORD: ${{ secrets.REDDIT_PASSWORD }} | |
| shell: bash | |
| run: | | |
| python -m pytest \ | |
| -rxXs \ | |
| --tb=native \ | |
| --verbose \ | |
| --color=yes \ | |
| --cov=src \ | |
| --junitxml=junit.xml \ | |
| -o junit_family=legacy \ | |
| tests | |
| - name: Upload test results to Codecov | |
| # any except canceled or skipped | |
| if: >- | |
| always() && | |
| (steps.test.outcome == 'success' || steps.test.outcome == 'failure') && | |
| startsWith(github.repository, 'LizardByte/') | |
| uses: codecov/test-results-action@v1 | |
| with: | |
| fail_ci_if_error: true | |
| files: junit.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| verbose: true | |
| - name: Upload coverage | |
| # any except canceled or skipped | |
| if: >- | |
| always() && | |
| (steps.test.outcome == 'success' || steps.test.outcome == 'failure') && | |
| startsWith(github.repository, 'LizardByte/') | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| fail_ci_if_error: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| verbose: true | |
| - name: Create/Update GitHub Release | |
| if: >- | |
| (github.event_name == 'push' && github.ref == 'refs/heads/master') && | |
| steps.setup-release.outputs.publish_release == 'true' | |
| uses: LizardByte/create-release-action@v2025.426.1549 | |
| with: | |
| allowUpdates: true | |
| artifacts: '' | |
| body: ${{ steps.setup-release.outputs.release_body }} | |
| generateReleaseNotes: ${{ steps.setup-release.outputs.release_generate_release_notes }} | |
| name: ${{ steps.setup-release.outputs.release_tag }} | |
| prerelease: true | |
| tag: ${{ steps.setup-release.outputs.release_tag }} | |
| token: ${{ secrets.GH_BOT_TOKEN }} |