From aad0e57183d471a08b0ee58953c2786dd8acfe1b Mon Sep 17 00:00:00 2001 From: LilSpazJoekp <15524072+LilSpazJoekp@users.noreply.github.com> Date: Tue, 27 Dec 2022 15:50:34 -0600 Subject: [PATCH 1/2] Remove unused dependencies Update pre-commit --- .pre-commit-config.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4099fc0..2a8c332 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,25 +1,25 @@ repos: + - repo: https://github.com/pre-commit/pre-commit-hooks hooks: - id: end-of-file-fixer exclude: .*\.txt - rev: v4.1.0 + rev: v4.4.0 - repo: https://github.com/psf/black hooks: - id: black - rev: 21.12b0 + rev: 22.12.0 - repo: https://github.com/LilSpazJoekp/docstrfmt hooks: - id: docstrfmt - require_serial: true - rev: v1.4.3 + rev: v1.5.1 - repo: https://github.com/pycqa/flake8 hooks: - id: flake8 - rev: 4.0.1 + rev: 6.0.0 - repo: https://github.com/ikamensh/flynt/ hooks: @@ -27,15 +27,15 @@ repos: args: - '-ll' - '1000' - rev: '0.69' + rev: '0.77' - repo: https://github.com/pycqa/isort hooks: - id: isort - rev: 5.10.1 + rev: 5.11.4 - repo: https://github.com/pycqa/pydocstyle hooks: - id: pydocstyle files: prawcore/.* - rev: 6.1.1 + rev: 6.2.3 From 12aae7aa462778d6aed5d0a804516a9d7158b4ff Mon Sep 17 00:00:00 2001 From: LilSpazJoekp <15524072+LilSpazJoekp@users.noreply.github.com> Date: Tue, 27 Dec 2022 16:06:32 -0600 Subject: [PATCH 2/2] Consolidate GitHub Actions workflows --- .github/workflows/ci.yml | 98 ++------------------- .github/workflows/manual_tag_release.yml | 14 +++ .github/workflows/pre-commit_autoupdate.yml | 10 +++ .github/workflows/prepare_release.yml | 14 +++ .github/workflows/pypi.yml | 9 ++ .github/workflows/scorecards-analysis.yml | 12 +++ .github/workflows/tag_release.yml | 9 ++ 7 files changed, 75 insertions(+), 91 deletions(-) create mode 100644 .github/workflows/manual_tag_release.yml create mode 100644 .github/workflows/pre-commit_autoupdate.yml create mode 100644 .github/workflows/prepare_release.yml create mode 100644 .github/workflows/pypi.yml create mode 100644 .github/workflows/scorecards-analysis.yml create mode 100644 .github/workflows/tag_release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 205b5f7..0c4c453 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,93 +1,9 @@ jobs: - complete_coveralls: - needs: test-multi-python - runs-on: ubuntu-latest - steps: - - name: Coveralls Finished - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - parallel-finished: true - lint-multi-os: - name: Lint ${{ matrix.os }} - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: 3.x - - uses: actions/cache@v1 - with: - key: v0-${{ runner.os }}-pip-lint-${{ hashFiles('setup.py') }} - path: ~/.cache/pip - restore-keys: | - v0-${{ runner.os }}-pip-lint- - v0-${{ runner.os }}-pip- - - name: Install dependencies - run: | - # Pin pip to 21.x for now to avoid error in pre-commit action on Win - python -m pip install --upgrade pip==21.* setuptools wheel - pip install .[lint] - - name: Run pre-commit hooks - uses: pre-commit/action@v2.0.3 - strategy: - matrix: - os: [macOS-latest, ubuntu-latest, windows-latest] - test-multi-os: - name: Test ${{ matrix.os }} - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: 3.x - - uses: actions/cache@v1 - with: - key: v0-${{ runner.os }}-pip-test-${{ hashFiles('setup.py') }} - path: ~/.cache/pip - restore-keys: | - v0-${{ runner.os }}-pip-test- - v0-${{ runner.os }}-pip- - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install .[test] - - name: Test with pytest - run: pytest - strategy: - matrix: - os: [macOS-latest, ubuntu-latest, windows-latest] - test-multi-python: - name: Test Python ${{ matrix.python-version }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - uses: actions/cache@v1 - with: - key: v0-${{ runner.os }}-pip-test-${{ hashFiles('setup.py') }} - path: ~/.cache/pip - restore-keys: | - v0-${{ runner.os }}-pip-test- - v0-${{ runner.os }}-pip- - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install .[test] - pip install .[ci] - - name: Test with pytest - run: coverage run --source prawcore --module pytest - - env: - COVERALLS_PARALLEL: true - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Submit to coveralls - run: coveralls --service=github - - name: Check coverage - run: coverage report -m --fail-under=100 - strategy: - matrix: - python-version: [3.7, 3.8, 3.9, '3.10'] + ci: + name: CI + secrets: inherit + uses: praw-dev/.github/.github/workflows/ci.yml@main + with: + package: prawcore name: CI -on: [pull_request, push] +on: [ pull_request, push ] diff --git a/.github/workflows/manual_tag_release.yml b/.github/workflows/manual_tag_release.yml new file mode 100644 index 0000000..6145d4a --- /dev/null +++ b/.github/workflows/manual_tag_release.yml @@ -0,0 +1,14 @@ +jobs: + manual_tag_release: + name: Manual Tag Release + secrets: inherit + uses: praw-dev/.github/.github/workflows/manual_tag_release.yml@main + with: + commit: ${{ inputs.commit }} +name: Manual Tag Release +on: + workflow_dispatch: + inputs: + commit: + description: The commit the version bump occurred + required: true diff --git a/.github/workflows/pre-commit_autoupdate.yml b/.github/workflows/pre-commit_autoupdate.yml new file mode 100644 index 0000000..15654bb --- /dev/null +++ b/.github/workflows/pre-commit_autoupdate.yml @@ -0,0 +1,10 @@ +jobs: + pre-commit_autoupdate: + name: Update pre-commit hooks + secrets: inherit + uses: praw-dev/.github/.github/workflows/pre-commit_autoupdate.yml@main +name: Update pre-commit hooks +on: + schedule: + - cron: 0 15 * * 1 + workflow_dispatch: diff --git a/.github/workflows/prepare_release.yml b/.github/workflows/prepare_release.yml new file mode 100644 index 0000000..4b3472a --- /dev/null +++ b/.github/workflows/prepare_release.yml @@ -0,0 +1,14 @@ +jobs: + prepare_release: + name: Prepare Release + secrets: inherit + uses: praw-dev/.github/.github/workflows/prepare_release.yml@main + with: + commit: ${{ inputs.version }} +name: Prepare Release +on: + workflow_dispatch: + inputs: + version: + description: The version to prepare for release + required: true diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 0000000..35525bd --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,9 @@ +jobs: + pypi: + name: Upload Python Package + secrets: inherit + uses: praw-dev/.github/.github/workflows/pypi.yml@main +name: Upload Python Package +on: + release: + types: [ published ] diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml new file mode 100644 index 0000000..2ba639a --- /dev/null +++ b/.github/workflows/scorecards-analysis.yml @@ -0,0 +1,12 @@ +jobs: + scorecards-analysis: + name: Scorecards supply-chain security + secrets: inherit + uses: praw-dev/.github/.github/workflows/scorecards-analysis.yml@main +name: Scorecards supply-chain security +on: + branch_protection_rule: + push: + branches: [ main ] + schedule: + - cron: 30 1 * * 6 diff --git a/.github/workflows/tag_release.yml b/.github/workflows/tag_release.yml new file mode 100644 index 0000000..c81bf9d --- /dev/null +++ b/.github/workflows/tag_release.yml @@ -0,0 +1,9 @@ +jobs: + tag_release: + name: Tag Release + secrets: inherit + uses: praw-dev/.github/.github/workflows/tag_release.yml@main +name: Tag Release +on: + push: + branches: [ main, release_test ]