Skip to content

Commit

Permalink
chore: 指定 Python 版本
Browse files Browse the repository at this point in the history
  • Loading branch information
l7wei committed Nov 26, 2024
1 parent 1f1ac84 commit da1dbaa
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 116 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
name: pre-commit

on:
pull_request:
push:
branches: [main]
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.1
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.11"
- uses: pre-commit/action@v3.0.1
66 changes: 33 additions & 33 deletions .github/workflows/routine_testing.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
name: Routine Testing

on:
schedule:
- cron: '0 12 * * 1,3,5'
schedule:
- cron: "0 12 * * 1,3,5"

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "*"
- uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('requirements-tests.txt') }}-test-v06
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install -r requirements.txt
pip install -r requirements-tests.txt
- name: Test
run: python -m pytest -n auto tests -W ignore::DeprecationWarning --cov=src --cov=tests --cov-report=xml --cov-report=html:coverage --cov-fail-under=85
- name: Store coverage files
uses: actions/upload-artifact@v4
with:
name: coverage
path: |
coverage
coverage.xml
test:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('requirements-tests.txt') }}-test-v06
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install -r requirements.txt
pip install -r requirements-tests.txt
- name: Test
run: python -m pytest -n auto tests -W ignore::DeprecationWarning --cov=src --cov=tests --cov-report=xml --cov-report=html:coverage --cov-fail-under=85
- name: Store coverage files
uses: actions/upload-artifact@v4
with:
name: coverage
path: |
coverage
coverage.xml
70 changes: 35 additions & 35 deletions .github/workflows/smokeshow.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
name: Generate Coverage

on:
workflow_run:
workflows: [Test]
types: [completed]
workflow_run:
workflows: [Test]
types: [completed]

permissions:
statuses: write
statuses: write

jobs:
context:
if: ${{ github.event.workflow_run.event == 'push' && github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
context:
if: ${{ github.event.workflow_run.event == 'push' && github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest

steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"

smokeshow:
needs: context
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/setup-python@v5
with:
python-version: "*"
- run: pip install smokeshow
- uses: dawidd6/action-download-artifact@v6
with:
workflow: tests.yml
commit: ${{ github.event.workflow_run.head_sha }}
- run: smokeshow upload coverage/coverage
env:
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 85
SMOKESHOW_GITHUB_CONTEXT: Coverage
SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
SMOKESHOW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
smokeshow:
needs: context
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install smokeshow
- uses: dawidd6/action-download-artifact@v6
with:
workflow: tests.yml
commit: ${{ github.event.workflow_run.head_sha }}
- run: smokeshow upload coverage/coverage
env:
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 85
SMOKESHOW_GITHUB_CONTEXT: Coverage
SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
SMOKESHOW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78 changes: 39 additions & 39 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,44 @@
name: Test

on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "*"
- uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('requirements-tests.txt') }}-test-v06
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install -r requirements.txt
pip install -r requirements-tests.txt
- name: Test
run: python -m pytest -n auto tests -W ignore::DeprecationWarning --cov=src --cov=tests --cov-report=xml --cov-report=html:coverage --cov-fail-under=85
- name: Store coverage files
uses: actions/upload-artifact@v4
with:
name: coverage
path: |
coverage
coverage.xml
test:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('requirements-tests.txt') }}-test-v06
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install -r requirements.txt
pip install -r requirements-tests.txt
- name: Test
run: python -m pytest -n auto tests -W ignore::DeprecationWarning --cov=src --cov=tests --cov-report=xml --cov-report=html:coverage --cov-fail-under=85
- name: Store coverage files
uses: actions/upload-artifact@v4
with:
name: coverage
path: |
coverage
coverage.xml

0 comments on commit da1dbaa

Please sign in to comment.