ci: rerun #102
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: | |
push: | |
branches: | |
- main | |
tags-ignore: | |
- '**' | |
paths: | |
- '.github/workflows/CI.yml' | |
- 'python_weather/**/*.py' | |
pull_request: null | |
jobs: | |
ci: | |
name: Run tests and pretty files | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Pull previous commit | |
run: git reset --soft HEAD~1 | |
shell: bash | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.8' | |
architecture: x64 | |
- name: Install dependencies | |
run: python3 -m pip install . | |
- name: Run test | |
run: python3 test.py | |
- name: Install yapf | |
run: | | |
python3 -m pip install toml | |
python3 -m pip install ruff | |
- name: Lint files | |
run: python3 -m ruff check | |
- name: Pretty files | |
if: ${{ github.event_name != 'pull_request' }} | |
run: python3 -m ruff format | |
- name: Import GPG key | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.CI_GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.CI_GPG_PASS }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
- name: Create commit | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: EndBug/add-and-commit@v9 | |
with: | |
commit: -S | |
message: ${{ github.event.head_commit.message }} | |
push: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push commit | |
run: git push -f | |
shell: bash |