Skip to content

Commit d8a0822

Browse files
authored
Merge pull request libgit2#5697 from libgit2/ethomson/actions
ci: stop using deprecated set-env in GitHub Actions
2 parents 2a51679 + 3dc238c commit d8a0822

File tree

18 files changed

+217
-24
lines changed

18 files changed

+217
-24
lines changed

.github/workflows/coverity.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Nightly build for the master branch running coverity.
2+
name: Coverity Build
3+
4+
on:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: '15 2 * * *'
8+
9+
env:
10+
docker-registry: docker.pkg.github.com
11+
docker-config-path: ci/docker
12+
13+
jobs:
14+
build:
15+
name: Coverity
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Check out repository
19+
uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0
22+
- name: Download container
23+
run: ci/getcontainer.sh ci/docker/xenial
24+
env:
25+
DOCKER_REGISTRY: ${{ env.docker-registry }}
26+
GITHUB_TOKEN: ${{ secrets.github_token }}
27+
- name: Run Coverity
28+
run: ci/coverity.sh
29+
env:
30+
COVERITY_TOKEN: ${{ secrets.coverity_token }}

.github/workflows/main.yml

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

1111
env:
1212
docker-registry: docker.pkg.github.com
13-
docker-config-path: azure-pipelines/docker
13+
docker-config-path: ci/docker
1414

1515
jobs:
1616
# Build the docker container images that we will use for our Linux
@@ -38,7 +38,7 @@ jobs:
3838
fetch-depth: 0
3939
if: github.event_name == 'push'
4040
- name: Download existing container
41-
run: azure-pipelines/getcontainer.sh ${{ env.docker-config-path }}/${{ matrix.container }}
41+
run: ci/getcontainer.sh ${{ env.docker-config-path }}/${{ matrix.container }}
4242
env:
4343
DOCKER_REGISTRY: ${{ env.docker-registry }}
4444
GITHUB_TOKEN: ${{ secrets.github_token }}
@@ -166,11 +166,11 @@ jobs:
166166
with:
167167
fetch-depth: 0
168168
- name: Set up build environment
169-
run: azure-pipelines/setup-${{ matrix.platform.setup-script }}.sh
169+
run: ci/setup-${{ matrix.platform.setup-script }}.sh
170170
shell: bash
171171
if: matrix.platform.setup-script != ''
172172
- name: Download container
173-
run: azure-pipelines/getcontainer.sh ${{ env.docker-config-path }}/${{ matrix.platform.image }}
173+
run: ci/getcontainer.sh ${{ env.docker-config-path }}/${{ matrix.platform.image }}
174174
env:
175175
DOCKER_REGISTRY: ${{ env.docker-registry }}
176176
GITHUB_TOKEN: ${{ secrets.github_token }}
@@ -198,11 +198,11 @@ jobs:
198198
-e SKIP_NEGOTIATE_TESTS \
199199
-e SKIP_SSH_TESTS \
200200
${{ env.docker-registry-container-sha }} \
201-
/bin/bash -c "mkdir build && cd build && ../azure-pipelines/build.sh && ../azure-pipelines/test.sh"
201+
/bin/bash -c "mkdir build && cd build && ../ci/build.sh && ../ci/test.sh"
202202
else
203203
mkdir build && cd build
204-
../azure-pipelines/build.sh
205-
../azure-pipelines/test.sh
204+
../ci/build.sh
205+
../ci/test.sh
206206
fi
207207
shell: bash
208208

.github/workflows/nightly.yml

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
# Nightly build for the master branch across multiple targets.
2+
name: Nightly Build
3+
4+
on:
5+
schedule:
6+
- cron: '15 1 * * *'
7+
8+
env:
9+
docker-registry: docker.pkg.github.com
10+
docker-config-path: ci/docker
11+
12+
jobs:
13+
build:
14+
name: Build
15+
strategy:
16+
matrix:
17+
platform:
18+
- # Xenial, GCC, OpenSSL
19+
image: xenial
20+
env:
21+
CC: gcc
22+
CMAKE_GENERATOR: Ninja
23+
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
24+
os: ubuntu-latest
25+
- # Xenial, GCC, mbedTLS
26+
image: xenial
27+
env:
28+
CC: gcc
29+
CMAKE_GENERATOR: Ninja
30+
CMAKE_OPTIONS: -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
31+
os: ubuntu-latest
32+
- # Xenial, Clang, OpenSSL
33+
image: xenial
34+
env:
35+
CC: clang
36+
CMAKE_GENERATOR: Ninja
37+
CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
38+
os: ubuntu-latest
39+
- # Xenial, Clang, mbedTLS
40+
image: xenial
41+
env:
42+
CC: clang
43+
CMAKE_OPTIONS: -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON
44+
CMAKE_GENERATOR: Ninja
45+
os: ubuntu-latest
46+
- # Focal, Clang 10, mbedTLS, MemorySanitizer
47+
image: focal
48+
env:
49+
CC: clang-10
50+
CFLAGS: -fsanitize=memory -fsanitize-memory-track-origins=2 -fsanitize-blacklist=/home/libgit2/source/script/sanitizers.supp -fno-optimize-sibling-calls -fno-omit-frame-pointer
51+
CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local/msan -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON
52+
CMAKE_GENERATOR: Ninja
53+
SKIP_SSH_TESTS: true
54+
SKIP_NEGOTIATE_TESTS: true
55+
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10
56+
os: ubuntu-latest
57+
- # Focal, Clang 10, OpenSSL, UndefinedBehaviorSanitizer
58+
image: focal
59+
env:
60+
CC: clang-10
61+
CFLAGS: -fsanitize=undefined,nullability -fno-sanitize-recover=undefined,nullability -fsanitize-blacklist=/home/libgit2/source/script/sanitizers.supp -fno-optimize-sibling-calls -fno-omit-frame-pointer
62+
CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local -DUSE_HTTPS=OpenSSL -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON
63+
CMAKE_GENERATOR: Ninja
64+
SKIP_SSH_TESTS: true
65+
SKIP_NEGOTIATE_TESTS: true
66+
ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10
67+
os: ubuntu-latest
68+
- # macOS
69+
os: macos-10.15
70+
env:
71+
CC: clang
72+
CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=leaks -DUSE_GSSAPI=ON
73+
CMAKE_GENERATOR: Ninja
74+
PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig
75+
SKIP_SSH_TESTS: true
76+
SKIP_NEGOTIATE_TESTS: true
77+
setup-script: osx
78+
- # Windows amd64 Visual Studio
79+
os: windows-2019
80+
env:
81+
ARCH: amd64
82+
CMAKE_GENERATOR: Visual Studio 16 2019
83+
CMAKE_OPTIONS: -A x64 -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON
84+
SKIP_SSH_TESTS: true
85+
SKIP_NEGOTIATE_TESTS: true
86+
- # Windows x86 Visual Studio
87+
os: windows-2019
88+
env:
89+
ARCH: x86
90+
CMAKE_GENERATOR: Visual Studio 16 2019
91+
CMAKE_OPTIONS: -A Win32 -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON -DUSE_SHA1=HTTPS -DUSE_BUNDLED_ZLIB=ON
92+
SKIP_SSH_TESTS: true
93+
SKIP_NEGOTIATE_TESTS: true
94+
- # Windows amd64 mingw
95+
os: windows-2019
96+
setup-script: mingw
97+
env:
98+
ARCH: amd64
99+
CMAKE_GENERATOR: MinGW Makefiles
100+
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON
101+
BUILD_TEMP: D:\Temp
102+
BUILD_PATH: D:\Temp\mingw64\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin
103+
SKIP_SSH_TESTS: true
104+
SKIP_NEGOTIATE_TESTS: true
105+
- # Windows x86 mingw
106+
os: windows-2019
107+
setup-script: mingw
108+
env:
109+
ARCH: x86
110+
CMAKE_GENERATOR: MinGW Makefiles
111+
CMAKE_OPTIONS: -DDEPRECATE_HARD=ON
112+
BUILD_TEMP: D:\Temp
113+
BUILD_PATH: D:\Temp\mingw32\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin
114+
SKIP_SSH_TESTS: true
115+
SKIP_NEGOTIATE_TESTS: true
116+
fail-fast: false
117+
env: ${{ matrix.platform.env }}
118+
runs-on: ${{ matrix.platform.os }}
119+
steps:
120+
- name: Check out repository
121+
uses: actions/checkout@v2
122+
with:
123+
fetch-depth: 0
124+
- name: Set up build environment
125+
run: ci/setup-${{ matrix.platform.setup-script }}.sh
126+
shell: bash
127+
if: matrix.platform.setup-script != ''
128+
- name: Download container
129+
run: ci/getcontainer.sh ${{ env.docker-config-path }}/${{ matrix.platform.image }}
130+
env:
131+
DOCKER_REGISTRY: ${{ env.docker-registry }}
132+
GITHUB_TOKEN: ${{ secrets.github_token }}
133+
if: matrix.platform.image != ''
134+
- name: Create container
135+
run: docker build -t ${{ env.docker-registry-container-sha }} -f ${{ matrix.platform.image }} .
136+
working-directory: ${{ env.docker-config-path }}
137+
if: matrix.platform.image != '' && env.docker-container-exists != 'true'
138+
- name: Build and test
139+
run: |
140+
export GITTEST_NEGOTIATE_PASSWORD="${{ secrets.GITTEST_NEGOTIATE_PASSWORD }}"
141+
142+
if [ -n "${{ matrix.platform.image }}" ]; then
143+
docker run \
144+
--rm \
145+
-v "$(pwd):/home/libgit2/source" \
146+
-w /home/libgit2/source \
147+
-e ASAN_SYMBOLIZER_PATH \
148+
-e CC \
149+
-e CFLAGS \
150+
-e CMAKE_GENERATOR \
151+
-e CMAKE_OPTIONS \
152+
-e GITTEST_NEGOTIATE_PASSWORD \
153+
-e PKG_CONFIG_PATH \
154+
-e SKIP_NEGOTIATE_TESTS \
155+
-e SKIP_SSH_TESTS \
156+
${{ env.docker-registry-container-sha }} \
157+
/bin/bash -c "mkdir build && cd build && ../ci/build.sh && ../ci/test.sh"
158+
else
159+
mkdir build && cd build
160+
../ci/build.sh
161+
../ci/test.sh
162+
fi
163+
shell: bash

azure-pipelines/bash.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# These are the steps used for building on machines with bash.
22
steps:
3-
- bash: . '$(Build.SourcesDirectory)/azure-pipelines/build.sh'
3+
- bash: . '$(Build.SourcesDirectory)/ci/build.sh'
44
displayName: Build
55
workingDirectory: '$(Build.BinariesDirectory)'
66
env: ${{ parameters.environmentVariables }}
7-
- bash: . '$(Build.SourcesDirectory)/azure-pipelines/test.sh'
7+
- bash: . '$(Build.SourcesDirectory)/ci/test.sh'
88
displayName: Test
99
workingDirectory: '$(Build.BinariesDirectory)'
1010
env: ${{ parameters.environmentVariables }}

azure-pipelines/coverity.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
vmImage: 'ubuntu-18.04'
99
steps:
1010
- script: |
11-
cd $(Build.SourcesDirectory)/azure-pipelines/docker
11+
cd $(Build.SourcesDirectory)/ci/docker
1212
docker build -t libgit2/xenial --build-arg BASE=ubuntu:xenial -f xenial .
1313
displayName: 'Build Docker image'
1414
- task: Docker@0
@@ -22,5 +22,5 @@ jobs:
2222
envVars: |
2323
COVERITY_TOKEN=$(COVERITY_TOKEN)
2424
workDir: '/home/libgit2/build'
25-
containerCommand: '/home/libgit2/source/azure-pipelines/coverity.sh'
25+
containerCommand: '/home/libgit2/source/ci/coverity.sh'
2626
detached: false

azure-pipelines/docker.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ steps:
1313
if [ -f /tmp/dockercache/${{parameters.docker.image}}.tar ]; then docker load < /tmp/dockercache/${{parameters.docker.image}}.tar; fi
1414
displayName: 'Load Docker cache'
1515
- script: |
16-
cd $(Build.SourcesDirectory)/azure-pipelines/docker &&
16+
cd $(Build.SourcesDirectory)/ci/docker &&
1717
docker build -t libgit2/${{parameters.docker.image}} --build-arg BASE=${{parameters.docker.base}} -f ${{parameters.docker.image}} . &&
1818
if [ ! -d /tmp/dockercache ]; then mkdir /tmp/dockercache; fi &&
1919
docker save libgit2/${{parameters.docker.image}} $(docker history -q libgit2/${{parameters.docker.image}} | grep -v '<missing>') > /tmp/dockercache/${{parameters.docker.image}}.tar
@@ -28,7 +28,7 @@ steps:
2828
$(Build.BinariesDirectory):/home/libgit2/build
2929
envVars: ${{ parameters.environmentVariables }}
3030
workDir: '/home/libgit2/build'
31-
containerCommand: '/home/libgit2/source/azure-pipelines/build.sh'
31+
containerCommand: '/home/libgit2/source/ci/build.sh'
3232
detached: false
3333
- task: docker@0
3434
displayName: Test
@@ -40,7 +40,7 @@ steps:
4040
$(Build.BinariesDirectory):/home/libgit2/build
4141
envVars: ${{ parameters.environmentVariables }}
4242
workDir: '/home/libgit2/build'
43-
containerCommand: '/home/libgit2/source/azure-pipelines/test.sh'
43+
containerCommand: '/home/libgit2/source/ci/test.sh'
4444
detached: false
4545
- task: publishtestresults@2
4646
displayName: Publish Test Results

azure-pipelines/nightly.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
pool:
7272
vmImage: 'macOS-10.15'
7373
steps:
74-
- bash: . '$(Build.SourcesDirectory)/azure-pipelines/setup-osx.sh'
74+
- bash: . '$(Build.SourcesDirectory)/ci/setup-osx.sh'
7575
displayName: Setup
7676
- template: bash.yml
7777
parameters:
@@ -114,7 +114,7 @@ jobs:
114114
pool:
115115
vmImage: 'vs2017-win2016'
116116
steps:
117-
- bash: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.sh'
117+
- bash: . '$(Build.SourcesDirectory)\ci\setup-mingw.sh'
118118
displayName: Setup
119119
env:
120120
TEMP: $(Agent.TempDirectory)
@@ -133,7 +133,7 @@ jobs:
133133
pool:
134134
vmImage: 'vs2017-win2016'
135135
steps:
136-
- bash: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.sh'
136+
- bash: . '$(Build.SourcesDirectory)\ci\setup-mingw.sh'
137137
displayName: Setup
138138
workingDirectory: '$(Build.BinariesDirectory)'
139139
env:
File renamed without changes.

0 commit comments

Comments
 (0)