Skip to content

Commit 0a7c00b

Browse files
committed
Merge remote-tracking branch 'origin/main' into main
2 parents a754167 + 2b28ee7 commit 0a7c00b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+982
-153
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- cron: '21 3 * * 1'
77

88
env:
9-
docker-registry: docker.pkg.github.com
9+
docker-registry: ghcr.io
1010

1111
jobs:
1212
analyze:

.github/workflows/main.yml

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
workflow_dispatch:
1111

1212
env:
13-
docker-registry: docker.pkg.github.com
13+
docker-registry: ghcr.io
1414
docker-config-path: source/ci/docker
1515

1616
jobs:
@@ -69,7 +69,7 @@ jobs:
6969
if [ "${{ matrix.container.base }}" != "" ]; then
7070
BASE_ARG="--build-arg BASE=${{ matrix.container.base }}"
7171
fi
72-
docker build -t ${{ env.docker-registry-container-sha }} ${BASE_ARG} -f ${{ env.dockerfile }} .
72+
docker build -t ${{ env.docker-registry-container-sha }} --build-arg UID=$(id -u) --build-arg GID=$(id -g) ${BASE_ARG} -f ${{ env.dockerfile }} .
7373
docker tag ${{ env.docker-registry-container-sha }} ${{ env.docker-registry-container-latest }}
7474
docker push ${{ env.docker-registry-container-sha }}
7575
docker push ${{ env.docker-registry-container-latest }}
@@ -85,6 +85,7 @@ jobs:
8585
matrix:
8686
platform:
8787
- name: "Linux (Xenial, GCC, OpenSSL)"
88+
id: xenial-gcc-openssl
8889
container:
8990
name: xenial
9091
env:
@@ -93,6 +94,7 @@ jobs:
9394
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON -DDEBUG_STRICT_ALLOC=ON -DDEBUG_STRICT_OPEN=ON
9495
os: ubuntu-latest
9596
- name: Linux (Xenial, GCC, mbedTLS)
97+
id: xenial-gcc-mbedtls
9698
container:
9799
name: xenial
98100
env:
@@ -101,6 +103,7 @@ jobs:
101103
CMAKE_OPTIONS: -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON
102104
os: ubuntu-latest
103105
- name: "Linux (Xenial, Clang, OpenSSL)"
106+
id: xenial-clang-openssl
104107
container:
105108
name: xenial
106109
env:
@@ -109,6 +112,7 @@ jobs:
109112
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON
110113
os: ubuntu-latest
111114
- name: "Linux (Xenial, Clang, mbedTLS)"
115+
id: xenial-clang-mbedtls
112116
container:
113117
name: xenial
114118
env:
@@ -117,6 +121,7 @@ jobs:
117121
CMAKE_GENERATOR: Ninja
118122
os: ubuntu-latest
119123
- name: "Linux (MemorySanitizer)"
124+
id: memorysanitizer
120125
container:
121126
name: focal
122127
env:
@@ -130,6 +135,7 @@ jobs:
130135
UBSAN_OPTIONS: print_stacktrace=1
131136
os: ubuntu-latest
132137
- name: "Linux (UndefinedBehaviorSanitizer)"
138+
id: ubsanitizer
133139
container:
134140
name: focal
135141
env:
@@ -143,6 +149,7 @@ jobs:
143149
UBSAN_OPTIONS: print_stacktrace=1
144150
os: ubuntu-latest
145151
- name: "Linux (ThreadSanitizer)"
152+
id: threadsanitizer
146153
container:
147154
name: focal
148155
env:
@@ -157,6 +164,7 @@ jobs:
157164
TSAN_OPTIONS: suppressions=/home/libgit2/source/script/thread-sanitizer.supp second_deadlock_stack=1
158165
os: ubuntu-latest
159166
- name: "macOS"
167+
id: macos
160168
os: macos-10.15
161169
env:
162170
CC: clang
@@ -166,6 +174,7 @@ jobs:
166174
SKIP_NEGOTIATE_TESTS: true
167175
setup-script: osx
168176
- name: "Windows (amd64, Visual Studio)"
177+
id: windows-amd64-vs
169178
os: windows-2019
170179
env:
171180
ARCH: amd64
@@ -174,6 +183,7 @@ jobs:
174183
SKIP_SSH_TESTS: true
175184
SKIP_NEGOTIATE_TESTS: true
176185
- name: "Windows (x86, Visual Studio)"
186+
id: windows-x86-vs
177187
os: windows-2019
178188
env:
179189
ARCH: x86
@@ -182,6 +192,7 @@ jobs:
182192
SKIP_SSH_TESTS: true
183193
SKIP_NEGOTIATE_TESTS: true
184194
- name: "Windows (amd64, mingw)"
195+
id: windows-amd64-mingw
185196
os: windows-2019
186197
setup-script: mingw
187198
env:
@@ -193,6 +204,7 @@ jobs:
193204
SKIP_SSH_TESTS: true
194205
SKIP_NEGOTIATE_TESTS: true
195206
- name: "Windows (x86, mingw)"
207+
id: windows-x86-mingw
196208
os: windows-2019
197209
setup-script: mingw
198210
env:
@@ -237,10 +249,12 @@ jobs:
237249
export GITTEST_NEGOTIATE_PASSWORD="${{ secrets.GITTEST_NEGOTIATE_PASSWORD }}"
238250
239251
if [ -n "${{ matrix.platform.container.name }}" ]; then
252+
mkdir build
240253
docker run \
241254
--rm \
242-
--user libgit2:libgit2 \
255+
--user "$(id -u):$(id -g)" \
243256
-v "$(pwd)/source:/home/libgit2/source" \
257+
-v "$(pwd)/build:/home/libgit2/build" \
244258
-w /home/libgit2 \
245259
-e ASAN_SYMBOLIZER_PATH \
246260
-e CC \
@@ -255,13 +269,33 @@ jobs:
255269
-e TSAN_OPTIONS \
256270
-e UBSAN_OPTIONS \
257271
${{ env.docker-registry-container-sha }} \
258-
/bin/bash -c "mkdir build && cd build && ../source/ci/build.sh && ../source/ci/test.sh"
272+
/bin/bash -c "cd build && ../source/ci/build.sh && ../source/ci/test.sh"
259273
else
260-
mkdir build && cd build
274+
mkdir build
275+
cd build
261276
../source/ci/build.sh
262277
../source/ci/test.sh
263278
fi
264279
shell: bash
280+
- name: Upload test results
281+
uses: actions/upload-artifact@v3
282+
if: success() || failure()
283+
with:
284+
name: test-results-${{ matrix.platform.id }}
285+
path: build/results_*.xml
286+
287+
test_results:
288+
name: Test results
289+
needs: [ build ]
290+
runs-on: ubuntu-latest
291+
steps:
292+
- name: Download test results
293+
uses: actions/download-artifact@v3
294+
- name: Generate test summary
295+
uses: test-summary/action@v1
296+
with:
297+
paths: 'test-results-*/*.xml'
298+
265299

266300
# Generate documentation using docurium. We'll upload the documentation
267301
# as a build artifact so that it can be reviewed as part of a pull
@@ -271,6 +305,7 @@ jobs:
271305
documentation:
272306
name: Generate documentation
273307
needs: [ containers ]
308+
if: success() || failure()
274309
runs-on: ubuntu-latest
275310
steps:
276311
- name: Check out repository

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- cron: '15 1 * * *'
88

99
env:
10-
docker-registry: docker.pkg.github.com
10+
docker-registry: ghcr.io
1111
docker-config-path: source/ci/docker
1212

1313
jobs:

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,8 @@ Here are the bindings to libgit2 that are currently available:
392392
* parrot-libgit2 <https://github.com/letolabs/parrot-libgit2>
393393
* Perl
394394
* Git-Raw <https://github.com/jacquesg/p5-Git-Raw>
395+
* Pharo Smalltalk
396+
* libgit2-pharo-bindings <https://github.com/pharo-vcs/libgit2-pharo-bindings>
395397
* PHP
396398
* php-git <https://github.com/libgit2/php-git>
397399
* Python
@@ -405,6 +407,8 @@ Here are the bindings to libgit2 that are currently available:
405407
* git2-rs <https://github.com/rust-lang/git2-rs>
406408
* Swift
407409
* SwiftGit2 <https://github.com/SwiftGit2/SwiftGit2>
410+
* Tcl
411+
* lg2 <https://github.com/apnadkarni/tcl-libgit2>
408412
* Vala
409413
* libgit2.vapi <https://github.com/apmasell/vapis/blob/master/libgit2.vapi>
410414

ci/docker/bionic

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ RUN cd /tmp && \
3838
rm -rf mbedtls-2.16.2
3939

4040
FROM mbedtls AS adduser
41-
RUN useradd --shell /bin/bash libgit2 --create-home
41+
ARG UID=""
42+
ARG GID=""
43+
RUN if [ "${UID}" != "" ]; then USER_ARG="--uid ${UID}"; fi && \
44+
if [ "${GID}" != "" ]; then GROUP_ARG="--gid ${GID}"; fi && \
45+
groupadd ${GROUP_ARG} libgit2 && \
46+
useradd ${USER_ARG} --gid libgit2 --shell /bin/bash --create-home libgit2
4247

4348
FROM adduser AS configure
4449
RUN mkdir /var/run/sshd

ci/docker/centos7

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ RUN cd /tmp && \
4848
rm -rf cmake-3.21.1
4949

5050
FROM cmake AS adduser
51-
RUN useradd --shell /bin/bash libgit2 --create-home
51+
ARG UID=""
52+
ARG GID=""
53+
RUN if [ "${UID}" != "" ]; then USER_ARG="--uid ${UID}"; fi && \
54+
if [ "${GID}" != "" ]; then GROUP_ARG="--gid ${GID}"; fi && \
55+
groupadd ${GROUP_ARG} libgit2 && \
56+
useradd ${USER_ARG} --gid libgit2 --shell /bin/bash --create-home libgit2
5257

5358
FROM adduser AS configure
5459
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig

ci/docker/centos8

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
ARG BASE=centos:8
22

3-
FROM ${BASE} AS yum
3+
FROM ${BASE} AS stream
4+
RUN dnf -y --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos && \
5+
dnf -y distro-sync
6+
7+
FROM stream AS yum
48
RUN yum install -y \
59
which \
610
bzip2 \
@@ -40,7 +44,12 @@ RUN cd /tmp && \
4044
rm -rf valgrind-3.15.0
4145

4246
FROM valgrind AS adduser
43-
RUN useradd --shell /bin/bash libgit2 --create-home
47+
ARG UID=""
48+
ARG GID=""
49+
RUN if [ "${UID}" != "" ]; then USER_ARG="--uid ${UID}"; fi && \
50+
if [ "${GID}" != "" ]; then GROUP_ARG="--gid ${GID}"; fi && \
51+
groupadd ${GROUP_ARG} libgit2 && \
52+
useradd ${USER_ARG} --gid libgit2 --shell /bin/bash --create-home libgit2
4453

4554
FROM adduser AS configure
4655
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig

ci/docker/focal

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,13 @@ RUN cd /tmp && \
7373
rm -rf valgrind-3.15.0
7474

7575
FROM valgrind AS adduser
76-
RUN useradd --shell /bin/bash libgit2 --create-home
76+
ARG UID=""
77+
ARG GID=""
78+
RUN if [ "${UID}" != "" ]; then USER_ARG="--uid ${UID}"; fi && \
79+
if [ "${GID}" != "" ]; then GROUP_ARG="--gid ${GID}"; fi && \
80+
groupadd ${GROUP_ARG} libgit2 && \
81+
useradd ${USER_ARG} --gid libgit2 --shell /bin/bash --create-home libgit2
82+
7783

7884
FROM adduser AS configure
7985
RUN mkdir /var/run/sshd

ci/docker/xenial

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,13 @@ RUN cd /tmp && \
6060
rm -rf valgrind-3.15.0
6161

6262
FROM valgrind AS adduser
63-
RUN useradd --shell /bin/bash libgit2 --create-home
63+
ARG UID=""
64+
ARG GID=""
65+
RUN if [ "${UID}" != "" ]; then USER_ARG="--uid ${UID}"; fi && \
66+
if [ "${GID}" != "" ]; then GROUP_ARG="--gid ${GID}"; fi && \
67+
groupadd ${GROUP_ARG} libgit2 && \
68+
useradd ${USER_ARG} --gid libgit2 --shell /bin/bash --create-home libgit2
69+
6470

6571
FROM adduser AS configure
6672
RUN mkdir /var/run/sshd

ci/getcontainer.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,13 @@ DOCKER_REGISTRY_CONTAINER_SHA="${DOCKER_REGISTRY_CONTAINER}:${DOCKER_SHA}"
3737
echo "docker-registry-container-sha=${DOCKER_REGISTRY_CONTAINER_SHA}" >> $GITHUB_ENV
3838
echo "docker-registry-container-latest=${DOCKER_REGISTRY_CONTAINER}:latest" >> $GITHUB_ENV
3939

40+
echo "::: logging in to ${DOCKER_REGISTRY} as ${GITHUB_ACTOR}"
41+
4042
exists="true"
4143
docker login https://${DOCKER_REGISTRY} -u ${GITHUB_ACTOR} -p ${GITHUB_TOKEN} || exists="false"
4244

45+
echo "::: pulling ${DOCKER_REGISTRY_CONTAINER_SHA}"
46+
4347
if [ "${exists}" != "false" ]; then
4448
docker pull ${DOCKER_REGISTRY_CONTAINER_SHA} || exists="false"
4549
fi

0 commit comments

Comments
 (0)