-
-
Notifications
You must be signed in to change notification settings - Fork 18
49 lines (46 loc) · 1.44 KB
/
check_and_fix.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Check and formatting
on:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check_and_fix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
submodules: recursive
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install test
run: |
pip install -r requirements-dev.txt
pip install -r requirements-type.txt
pip install .
- name: Update emoji.json
run: curl -o src/sticker_convert/resources/emoji.json -L https://raw.githubusercontent.com/github/gemoji/master/db/emoji.json
- name: mypy
run: mypy
# Temporarily disabled due to Pillow typing issue
# https://github.com/python/typeshed/issues/11688
# - name: pyright
# run: pyright
- name: Ruff check
run: ruff check
- name: Ruff format
run: ruff format
- name: isort
run: isort .
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: Formatting
branch: ${{ steps.extract_branch.outputs.branch }}