66 pull_request :
77 branches : [master, main]
88
9+ permissions :
10+ contents : read
11+
12+ concurrency :
13+ group : pr-${{ github.event.pull_request.number || github.ref }}
14+ cancel-in-progress : true
15+
916jobs :
1017 unit-tests :
1118 name : Unit Tests
1219 runs-on : ubuntu-latest
1320 strategy :
1421 matrix :
15- python-version : [' 3.9', ' 3.10', ' 3.11' ]
22+ python-version : [" 3.9", " 3.10", " 3.11" ]
1623
1724 steps :
1825 - name : Checkout code
19- uses : actions/checkout@v4
26+ uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
2027
2128 - name : Set up Python ${{ matrix.python-version }}
22- uses : actions/setup-python@v5
29+ uses : actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
2330 with :
2431 python-version : ${{ matrix.python-version }}
2532
3441 PYTHONPATH=src pytest tests/unit/ -v --cov=src/create_pull_request --cov-report=xml --cov-report=term
3542
3643 - name : Upload coverage to Codecov
37- uses : codecov/codecov-action@v4
44+ uses : codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4
3845 if : matrix.python-version == '3.11'
3946 with :
4047 file : ./coverage.xml
@@ -47,12 +54,12 @@ jobs:
4754
4855 steps :
4956 - name : Checkout code
50- uses : actions/checkout@v4
57+ uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
5158
5259 - name : Set up Python
53- uses : actions/setup-python@v5
60+ uses : actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
5461 with :
55- python-version : ' 3.11'
62+ python-version : " 3.11"
5663
5764 - name : Install dependencies
5865 run : |
@@ -75,18 +82,19 @@ jobs:
7582
7683 steps :
7784 - name : Checkout code
78- uses : actions/checkout@v4
85+ uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
7986
8087 - name : Set up Docker Buildx
81- uses : docker/setup-buildx-action@v3
88+ uses : docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
8289
8390 - name : Build Docker image
8491 run : |
8592 docker build -t create-pull-request-python:test .
8693
87- - name : Test Docker image
94+ - name : Verify Python module resolves
8895 run : |
89- docker run --rm create-pull-request-python:test --help || true
96+ docker run --rm --entrypoint python create-pull-request-python:test \
97+ -c "from create_pull_request.main import run; print('Module import OK')"
9098
9199 - name : Check image size
92100 run : |
@@ -98,25 +106,30 @@ jobs:
98106
99107 steps :
100108 - name : Checkout code
101- uses : actions/checkout@v4
109+ uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
102110
103111 - name : Set up Python
104- uses : actions/setup-python@v5
112+ uses : actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
105113 with :
106- python-version : ' 3.11'
114+ python-version : " 3.11"
107115
108116 - name : Install dependencies
109117 run : |
110118 python -m pip install --upgrade pip
119+ pip install -r requirements.txt
111120 pip install ruff mypy
112121
113- - name : Run ruff
122+ - name : Run ruff lint
114123 run : |
115124 ruff check src/
116125
126+ - name : Run ruff format check
127+ run : |
128+ ruff format --check src/
129+
117130 - name : Run mypy
118131 run : |
119- mypy src/create_pull_request --ignore-missing-imports || true
132+ mypy src/create_pull_request --ignore-missing-imports
120133
121134 all-checks :
122135 name : All Checks Passed
0 commit comments