chore: update global workflows #300
Workflow file for this run
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
--- | |
name: CI | |
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: | |
pytest: | |
runs-on: ubuntu-latest | |
steps: | |
- 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: | |
INPUT_GITHUB_TOKEN: ${{ github.actor == 'dependabot[bot]' && secrets.GH_BOT_TOKEN || secrets.GITHUB_TOKEN }} | |
shell: bash | |
run: | | |
python -m pytest \ | |
-rxXs \ | |
--tb=native \ | |
--verbose \ | |
--color=yes \ | |
--cov=action \ | |
tests | |
- 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@v4 | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
action: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Dump github context | |
env: | |
GH_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GH_CONTEXT" | |
shell: bash | |
- name: Debug | |
run: | | |
echo "GITHUB_EVENT_PATH: ${GITHUB_EVENT_PATH}" | |
echo "---------------------------------------" | |
cat $GITHUB_EVENT_PATH | |
- name: Run Action | |
id: action | |
uses: ./ | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Print action outputs | |
shell: bash | |
run: | | |
echo "publish_release: ${{ steps.action.outputs.publish_release }}" | |
echo "release_body: ${{ steps.action.outputs.release_body }}" | |
echo "release_commit: ${{ steps.action.outputs.release_commit }}" | |
echo "release_generate_release_notes: ${{ steps.action.outputs.release_generate_release_notes }}" | |
echo "release_tag: ${{ steps.action.outputs.release_tag }}" | |
echo "release_version: ${{ steps.action.outputs.release_version }}" | |
release: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
needs: | |
- pytest | |
- action | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Run Action | |
id: setup-release | |
uses: ./ | |
with: | |
github_token: ${{ secrets.GH_BOT_TOKEN }} | |
- name: Create Release | |
id: action | |
uses: LizardByte/create-release-action@master # keep this on master, to prevent endless dependabot PRs | |
with: | |
allowUpdates: false | |
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 }} |