Melika Kheirieh commited on
Commit
0b80dce
·
1 Parent(s): 21bb5b5

Fix bug in ci.yml

Browse files
Files changed (1) hide show
  1. .github/workflows/ci.yml +17 -2
.github/workflows/ci.yml CHANGED
@@ -5,13 +5,20 @@ on:
5
  branches: [ main, develop ]
6
  pull_request:
7
 
 
 
 
 
 
8
  jobs:
9
  build-test:
10
  runs-on: ubuntu-latest
11
  permissions:
12
  contents: read
13
  env:
14
- PIP_NO_CACHE_DIR: 1
 
 
15
 
16
  steps:
17
  - name: Checkout repository
@@ -22,13 +29,21 @@ jobs:
22
  with:
23
  python-version: "3.12"
24
  cache: "pip"
 
 
 
25
 
26
  - name: Install dependencies
27
  run: |
28
  python -m pip install --upgrade pip
29
  pip install -r requirements.txt
 
 
30
  python -m pip install ruff mypy pytest
31
 
 
 
 
32
  - name: Lint (ruff)
33
  run: python -m ruff check .
34
 
@@ -67,7 +82,7 @@ jobs:
67
  docker build -t "$IMAGE" .
68
  echo "IMAGE=$IMAGE" >> $GITHUB_ENV
69
 
70
- - name: Push image
71
  run: docker push "$IMAGE"
72
 
73
  - name: Tag 'latest' and push
 
5
  branches: [ main, develop ]
6
  pull_request:
7
 
8
+
9
+ concurrency:
10
+ group: ci-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
  jobs:
14
  build-test:
15
  runs-on: ubuntu-latest
16
  permissions:
17
  contents: read
18
  env:
19
+ PIP_NO_CACHE_DIR: 0
20
+ PROXY_API_KEY: ${{ secrets.PROXY_API_KEY }}
21
+ PROXY_BASE_URL: ${{ secrets.PROXY_BASE_URL }}
22
 
23
  steps:
24
  - name: Checkout repository
 
29
  with:
30
  python-version: "3.12"
31
  cache: "pip"
32
+ cache-dependency-path: |
33
+ requirements.txt
34
+ requirements-dev.txt
35
 
36
  - name: Install dependencies
37
  run: |
38
  python -m pip install --upgrade pip
39
  pip install -r requirements.txt
40
+ # If you have a dev requirements file, use it instead:
41
+ # pip install -r requirements-dev.txt
42
  python -m pip install ruff mypy pytest
43
 
44
+ - name: Check code formatting (ruff)
45
+ run: python -m ruff format --check .
46
+
47
  - name: Lint (ruff)
48
  run: python -m ruff check .
49
 
 
82
  docker build -t "$IMAGE" .
83
  echo "IMAGE=$IMAGE" >> $GITHUB_ENV
84
 
85
+ - name: Push image (commit SHA tag)
86
  run: docker push "$IMAGE"
87
 
88
  - name: Tag 'latest' and push