Skip to content

Commit 0881042

Browse files
committed
Changes to make running the CI locally possible
1 parent ee5ec04 commit 0881042

File tree

1 file changed

+29
-15
lines changed

1 file changed

+29
-15
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ jobs:
2929

3030
- name: Get history and tags for SCM versioning to work
3131
run: |
32-
git fetch --prune --unshallow
33-
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
32+
if [ $(git rev-parse --is-shallow-repository) == "true" ]; then
33+
git fetch --prune --unshallow
34+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
35+
fi
3436
3537
- name: Setup Python ${{ matrix.python }}
3638
uses: actions/setup-python@v2
@@ -114,8 +116,10 @@ jobs:
114116

115117
- name: Get history and tags for SCM versioning to work
116118
run: |
117-
git fetch --prune --unshallow
118-
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
119+
if [ $(git rev-parse --is-shallow-repository) == "true" ]; then
120+
git fetch --prune --unshallow
121+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
122+
fi
119123
120124
- name: Prepare env
121125
run: >
@@ -124,10 +128,12 @@ jobs:
124128
python3-pytest python3-pytest-cov python3-flaky
125129
--no-install-recommends
126130
127-
- name: Fix Python LDSHARED
131+
- name: Fix environment variables for compilation with Clang
128132
run: |
129-
ld_args=$(python3 -c "import sysconfig; print(' '.join(sysconfig.get_config_var('LDSHARED').split()[1:]))")
130-
echo "LDSHARED='clang $ld_args'" >> $GITHUB_ENV
133+
ld_flags=$(python3 -c "import sysconfig; print(' '.join(sysconfig.get_config_var('LDSHARED').split()[1:]))")
134+
echo "LDSHARED=clang" >> $GITHUB_ENV
135+
echo "CFLAGS=-fPIC" >> $GITHUB_ENV
136+
echo "LDFLAGS=$ld_flags" >> $GITHUB_ENV
131137
132138
- name: Prepare Python env
133139
run: |
@@ -164,8 +170,10 @@ jobs:
164170

165171
- name: Get history and tags for SCM versioning to work
166172
run: |
167-
git fetch --prune --unshallow
168-
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
173+
if [ $(git rev-parse --is-shallow-repository) == "true" ]; then
174+
git fetch --prune --unshallow
175+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
176+
fi
169177
170178
- name: Prepare env
171179
run: >
@@ -232,8 +240,10 @@ jobs:
232240

233241
- name: Get history and tags for SCM versioning to work
234242
run: |
235-
git fetch --prune --unshallow
236-
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
243+
if [ $(git rev-parse --is-shallow-repository) == "true" ]; then
244+
git fetch --prune --unshallow
245+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
246+
fi
237247
238248
- name: Create pip cache dir
239249
run: mkdir -p ~/.cache/pip
@@ -283,8 +293,10 @@ jobs:
283293

284294
- name: Get history and tags for SCM versioning to work
285295
run: |
286-
git fetch --prune --unshallow
287-
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
296+
if [ $(git rev-parse --is-shallow-repository) == "true" ]; then
297+
git fetch --prune --unshallow
298+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
299+
fi
288300
289301
- uses: actions/setup-python@v2
290302

@@ -320,8 +332,10 @@ jobs:
320332

321333
- name: Get history and tags for SCM versioning to work
322334
run: |
323-
git fetch --prune --unshallow
324-
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
335+
if [ $(git rev-parse --is-shallow-repository) == "true" ]; then
336+
git fetch --prune --unshallow
337+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
338+
fi
325339
326340
- name: Get pip cache dir
327341
id: pip-cache

0 commit comments

Comments
 (0)