diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2020-11-18 19:32:11 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-18 19:32:11 +0000 |
commit | d8a08227caf6d5d5fc5593bbf00e178c8d2860ef (patch) | |
tree | cfcd91c78e0dc705849667828b3e493316907941 | |
parent | 2a51679005285e4e5f8642dd86dc35b46de772c1 (diff) | |
parent | 3dc238c393ca12d106803d6be8f5691606636f81 (diff) | |
download | libgit2-d8a08227caf6d5d5fc5593bbf00e178c8d2860ef.tar.gz |
Merge pull request #5697 from libgit2/ethomson/actions
ci: stop using deprecated set-env in GitHub Actions
-rw-r--r-- | .github/workflows/coverity.yml | 30 | ||||
-rw-r--r-- | .github/workflows/main.yml | 14 | ||||
-rw-r--r-- | .github/workflows/nightly.yml | 163 | ||||
-rw-r--r-- | azure-pipelines/bash.yml | 4 | ||||
-rw-r--r-- | azure-pipelines/coverity.yml | 4 | ||||
-rw-r--r-- | azure-pipelines/docker.yml | 6 | ||||
-rw-r--r-- | azure-pipelines/nightly.yml | 6 | ||||
-rwxr-xr-x | ci/build.sh (renamed from azure-pipelines/build.sh) | 0 | ||||
-rwxr-xr-x | ci/coverity.sh (renamed from azure-pipelines/coverity.sh) | 0 | ||||
-rw-r--r-- | ci/docker/bionic (renamed from azure-pipelines/docker/bionic) | 0 | ||||
-rw-r--r-- | ci/docker/docurium (renamed from azure-pipelines/docker/docurium) | 0 | ||||
-rw-r--r-- | ci/docker/entrypoint.sh (renamed from azure-pipelines/docker/entrypoint.sh) | 0 | ||||
-rw-r--r-- | ci/docker/focal (renamed from azure-pipelines/docker/focal) | 0 | ||||
-rw-r--r-- | ci/docker/xenial (renamed from azure-pipelines/docker/xenial) | 0 | ||||
-rwxr-xr-x | ci/getcontainer.sh (renamed from azure-pipelines/getcontainer.sh) | 14 | ||||
-rwxr-xr-x | ci/setup-mingw.sh (renamed from azure-pipelines/setup-mingw.sh) | 0 | ||||
-rwxr-xr-x | ci/setup-osx.sh (renamed from azure-pipelines/setup-osx.sh) | 0 | ||||
-rwxr-xr-x | ci/test.sh (renamed from azure-pipelines/test.sh) | 0 |
18 files changed, 217 insertions, 24 deletions
diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml new file mode 100644 index 000000000..99a4b151b --- /dev/null +++ b/.github/workflows/coverity.yml @@ -0,0 +1,30 @@ +# Nightly build for the master branch running coverity. +name: Coverity Build + +on: + workflow_dispatch: + schedule: + - cron: '15 2 * * *' + +env: + docker-registry: docker.pkg.github.com + docker-config-path: ci/docker + +jobs: + build: + name: Coverity + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Download container + run: ci/getcontainer.sh ci/docker/xenial + env: + DOCKER_REGISTRY: ${{ env.docker-registry }} + GITHUB_TOKEN: ${{ secrets.github_token }} + - name: Run Coverity + run: ci/coverity.sh + env: + COVERITY_TOKEN: ${{ secrets.coverity_token }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 29507c8f0..a36a0a0ef 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ on: env: docker-registry: docker.pkg.github.com - docker-config-path: azure-pipelines/docker + docker-config-path: ci/docker jobs: # Build the docker container images that we will use for our Linux @@ -38,7 +38,7 @@ jobs: fetch-depth: 0 if: github.event_name == 'push' - name: Download existing container - run: azure-pipelines/getcontainer.sh ${{ env.docker-config-path }}/${{ matrix.container }} + run: ci/getcontainer.sh ${{ env.docker-config-path }}/${{ matrix.container }} env: DOCKER_REGISTRY: ${{ env.docker-registry }} GITHUB_TOKEN: ${{ secrets.github_token }} @@ -166,11 +166,11 @@ jobs: with: fetch-depth: 0 - name: Set up build environment - run: azure-pipelines/setup-${{ matrix.platform.setup-script }}.sh + run: ci/setup-${{ matrix.platform.setup-script }}.sh shell: bash if: matrix.platform.setup-script != '' - name: Download container - run: azure-pipelines/getcontainer.sh ${{ env.docker-config-path }}/${{ matrix.platform.image }} + run: ci/getcontainer.sh ${{ env.docker-config-path }}/${{ matrix.platform.image }} env: DOCKER_REGISTRY: ${{ env.docker-registry }} GITHUB_TOKEN: ${{ secrets.github_token }} @@ -198,11 +198,11 @@ jobs: -e SKIP_NEGOTIATE_TESTS \ -e SKIP_SSH_TESTS \ ${{ env.docker-registry-container-sha }} \ - /bin/bash -c "mkdir build && cd build && ../azure-pipelines/build.sh && ../azure-pipelines/test.sh" + /bin/bash -c "mkdir build && cd build && ../ci/build.sh && ../ci/test.sh" else mkdir build && cd build - ../azure-pipelines/build.sh - ../azure-pipelines/test.sh + ../ci/build.sh + ../ci/test.sh fi shell: bash diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 000000000..c0e15539a --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,163 @@ +# Nightly build for the master branch across multiple targets. +name: Nightly Build + +on: + schedule: + - cron: '15 1 * * *' + +env: + docker-registry: docker.pkg.github.com + docker-config-path: ci/docker + +jobs: + build: + name: Build + strategy: + matrix: + platform: + - # Xenial, GCC, OpenSSL + image: xenial + env: + CC: gcc + CMAKE_GENERATOR: Ninja + CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON + os: ubuntu-latest + - # Xenial, GCC, mbedTLS + image: xenial + env: + CC: gcc + CMAKE_GENERATOR: Ninja + CMAKE_OPTIONS: -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON + os: ubuntu-latest + - # Xenial, Clang, OpenSSL + image: xenial + env: + CC: clang + CMAKE_GENERATOR: Ninja + CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON + os: ubuntu-latest + - # Xenial, Clang, mbedTLS + image: xenial + env: + CC: clang + CMAKE_OPTIONS: -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON + CMAKE_GENERATOR: Ninja + os: ubuntu-latest + - # Focal, Clang 10, mbedTLS, MemorySanitizer + image: focal + env: + CC: clang-10 + CFLAGS: -fsanitize=memory -fsanitize-memory-track-origins=2 -fsanitize-blacklist=/home/libgit2/source/script/sanitizers.supp -fno-optimize-sibling-calls -fno-omit-frame-pointer + CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local/msan -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON + CMAKE_GENERATOR: Ninja + SKIP_SSH_TESTS: true + SKIP_NEGOTIATE_TESTS: true + ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10 + os: ubuntu-latest + - # Focal, Clang 10, OpenSSL, UndefinedBehaviorSanitizer + image: focal + env: + CC: clang-10 + 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 + CMAKE_OPTIONS: -DCMAKE_PREFIX_PATH=/usr/local -DUSE_HTTPS=OpenSSL -DUSE_SHA1=HTTPS -DREGEX_BACKEND=pcre -DDEPRECATE_HARD=ON -DUSE_BUNDLED_ZLIB=ON + CMAKE_GENERATOR: Ninja + SKIP_SSH_TESTS: true + SKIP_NEGOTIATE_TESTS: true + ASAN_SYMBOLIZER_PATH: /usr/bin/llvm-symbolizer-10 + os: ubuntu-latest + - # macOS + os: macos-10.15 + env: + CC: clang + CMAKE_OPTIONS: -DREGEX_BACKEND=regcomp_l -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=leaks -DUSE_GSSAPI=ON + CMAKE_GENERATOR: Ninja + PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig + SKIP_SSH_TESTS: true + SKIP_NEGOTIATE_TESTS: true + setup-script: osx + - # Windows amd64 Visual Studio + os: windows-2019 + env: + ARCH: amd64 + CMAKE_GENERATOR: Visual Studio 16 2019 + CMAKE_OPTIONS: -A x64 -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON + SKIP_SSH_TESTS: true + SKIP_NEGOTIATE_TESTS: true + - # Windows x86 Visual Studio + os: windows-2019 + env: + ARCH: x86 + CMAKE_GENERATOR: Visual Studio 16 2019 + CMAKE_OPTIONS: -A Win32 -DMSVC_CRTDBG=ON -DDEPRECATE_HARD=ON -DUSE_SHA1=HTTPS -DUSE_BUNDLED_ZLIB=ON + SKIP_SSH_TESTS: true + SKIP_NEGOTIATE_TESTS: true + - # Windows amd64 mingw + os: windows-2019 + setup-script: mingw + env: + ARCH: amd64 + CMAKE_GENERATOR: MinGW Makefiles + CMAKE_OPTIONS: -DDEPRECATE_HARD=ON + BUILD_TEMP: D:\Temp + BUILD_PATH: D:\Temp\mingw64\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin + SKIP_SSH_TESTS: true + SKIP_NEGOTIATE_TESTS: true + - # Windows x86 mingw + os: windows-2019 + setup-script: mingw + env: + ARCH: x86 + CMAKE_GENERATOR: MinGW Makefiles + CMAKE_OPTIONS: -DDEPRECATE_HARD=ON + BUILD_TEMP: D:\Temp + BUILD_PATH: D:\Temp\mingw32\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CMake\bin + SKIP_SSH_TESTS: true + SKIP_NEGOTIATE_TESTS: true + fail-fast: false + env: ${{ matrix.platform.env }} + runs-on: ${{ matrix.platform.os }} + steps: + - name: Check out repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up build environment + run: ci/setup-${{ matrix.platform.setup-script }}.sh + shell: bash + if: matrix.platform.setup-script != '' + - name: Download container + run: ci/getcontainer.sh ${{ env.docker-config-path }}/${{ matrix.platform.image }} + env: + DOCKER_REGISTRY: ${{ env.docker-registry }} + GITHUB_TOKEN: ${{ secrets.github_token }} + if: matrix.platform.image != '' + - name: Create container + run: docker build -t ${{ env.docker-registry-container-sha }} -f ${{ matrix.platform.image }} . + working-directory: ${{ env.docker-config-path }} + if: matrix.platform.image != '' && env.docker-container-exists != 'true' + - name: Build and test + run: | + export GITTEST_NEGOTIATE_PASSWORD="${{ secrets.GITTEST_NEGOTIATE_PASSWORD }}" + + if [ -n "${{ matrix.platform.image }}" ]; then + docker run \ + --rm \ + -v "$(pwd):/home/libgit2/source" \ + -w /home/libgit2/source \ + -e ASAN_SYMBOLIZER_PATH \ + -e CC \ + -e CFLAGS \ + -e CMAKE_GENERATOR \ + -e CMAKE_OPTIONS \ + -e GITTEST_NEGOTIATE_PASSWORD \ + -e PKG_CONFIG_PATH \ + -e SKIP_NEGOTIATE_TESTS \ + -e SKIP_SSH_TESTS \ + ${{ env.docker-registry-container-sha }} \ + /bin/bash -c "mkdir build && cd build && ../ci/build.sh && ../ci/test.sh" + else + mkdir build && cd build + ../ci/build.sh + ../ci/test.sh + fi + shell: bash diff --git a/azure-pipelines/bash.yml b/azure-pipelines/bash.yml index 33a442b57..d776a3649 100644 --- a/azure-pipelines/bash.yml +++ b/azure-pipelines/bash.yml @@ -1,10 +1,10 @@ # These are the steps used for building on machines with bash. steps: -- bash: . '$(Build.SourcesDirectory)/azure-pipelines/build.sh' +- bash: . '$(Build.SourcesDirectory)/ci/build.sh' displayName: Build workingDirectory: '$(Build.BinariesDirectory)' env: ${{ parameters.environmentVariables }} -- bash: . '$(Build.SourcesDirectory)/azure-pipelines/test.sh' +- bash: . '$(Build.SourcesDirectory)/ci/test.sh' displayName: Test workingDirectory: '$(Build.BinariesDirectory)' env: ${{ parameters.environmentVariables }} diff --git a/azure-pipelines/coverity.yml b/azure-pipelines/coverity.yml index a8747db73..466f43693 100644 --- a/azure-pipelines/coverity.yml +++ b/azure-pipelines/coverity.yml @@ -8,7 +8,7 @@ jobs: vmImage: 'ubuntu-18.04' steps: - script: | - cd $(Build.SourcesDirectory)/azure-pipelines/docker + cd $(Build.SourcesDirectory)/ci/docker docker build -t libgit2/xenial --build-arg BASE=ubuntu:xenial -f xenial . displayName: 'Build Docker image' - task: Docker@0 @@ -22,5 +22,5 @@ jobs: envVars: | COVERITY_TOKEN=$(COVERITY_TOKEN) workDir: '/home/libgit2/build' - containerCommand: '/home/libgit2/source/azure-pipelines/coverity.sh' + containerCommand: '/home/libgit2/source/ci/coverity.sh' detached: false diff --git a/azure-pipelines/docker.yml b/azure-pipelines/docker.yml index 0f0885770..5bb58ee75 100644 --- a/azure-pipelines/docker.yml +++ b/azure-pipelines/docker.yml @@ -13,7 +13,7 @@ steps: if [ -f /tmp/dockercache/${{parameters.docker.image}}.tar ]; then docker load < /tmp/dockercache/${{parameters.docker.image}}.tar; fi displayName: 'Load Docker cache' - script: | - cd $(Build.SourcesDirectory)/azure-pipelines/docker && + cd $(Build.SourcesDirectory)/ci/docker && docker build -t libgit2/${{parameters.docker.image}} --build-arg BASE=${{parameters.docker.base}} -f ${{parameters.docker.image}} . && if [ ! -d /tmp/dockercache ]; then mkdir /tmp/dockercache; fi && 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: $(Build.BinariesDirectory):/home/libgit2/build envVars: ${{ parameters.environmentVariables }} workDir: '/home/libgit2/build' - containerCommand: '/home/libgit2/source/azure-pipelines/build.sh' + containerCommand: '/home/libgit2/source/ci/build.sh' detached: false - task: docker@0 displayName: Test @@ -40,7 +40,7 @@ steps: $(Build.BinariesDirectory):/home/libgit2/build envVars: ${{ parameters.environmentVariables }} workDir: '/home/libgit2/build' - containerCommand: '/home/libgit2/source/azure-pipelines/test.sh' + containerCommand: '/home/libgit2/source/ci/test.sh' detached: false - task: publishtestresults@2 displayName: Publish Test Results diff --git a/azure-pipelines/nightly.yml b/azure-pipelines/nightly.yml index a75a9cc24..97b447995 100644 --- a/azure-pipelines/nightly.yml +++ b/azure-pipelines/nightly.yml @@ -71,7 +71,7 @@ jobs: pool: vmImage: 'macOS-10.15' steps: - - bash: . '$(Build.SourcesDirectory)/azure-pipelines/setup-osx.sh' + - bash: . '$(Build.SourcesDirectory)/ci/setup-osx.sh' displayName: Setup - template: bash.yml parameters: @@ -114,7 +114,7 @@ jobs: pool: vmImage: 'vs2017-win2016' steps: - - bash: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.sh' + - bash: . '$(Build.SourcesDirectory)\ci\setup-mingw.sh' displayName: Setup env: TEMP: $(Agent.TempDirectory) @@ -133,7 +133,7 @@ jobs: pool: vmImage: 'vs2017-win2016' steps: - - bash: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.sh' + - bash: . '$(Build.SourcesDirectory)\ci\setup-mingw.sh' displayName: Setup workingDirectory: '$(Build.BinariesDirectory)' env: diff --git a/azure-pipelines/build.sh b/ci/build.sh index c230e67d6..c230e67d6 100755 --- a/azure-pipelines/build.sh +++ b/ci/build.sh diff --git a/azure-pipelines/coverity.sh b/ci/coverity.sh index c68b6f8cc..c68b6f8cc 100755 --- a/azure-pipelines/coverity.sh +++ b/ci/coverity.sh diff --git a/azure-pipelines/docker/bionic b/ci/docker/bionic index 5918584dc..5918584dc 100644 --- a/azure-pipelines/docker/bionic +++ b/ci/docker/bionic diff --git a/azure-pipelines/docker/docurium b/ci/docker/docurium index 54a4202b6..54a4202b6 100644 --- a/azure-pipelines/docker/docurium +++ b/ci/docker/docurium diff --git a/azure-pipelines/docker/entrypoint.sh b/ci/docker/entrypoint.sh index 8d96e3acd..8d96e3acd 100644 --- a/azure-pipelines/docker/entrypoint.sh +++ b/ci/docker/entrypoint.sh diff --git a/azure-pipelines/docker/focal b/ci/docker/focal index c75e85a4c..c75e85a4c 100644 --- a/azure-pipelines/docker/focal +++ b/ci/docker/focal diff --git a/azure-pipelines/docker/xenial b/ci/docker/xenial index 67867edc6..67867edc6 100644 --- a/azure-pipelines/docker/xenial +++ b/ci/docker/xenial diff --git a/azure-pipelines/getcontainer.sh b/ci/getcontainer.sh index bc93f4919..b259260f4 100755 --- a/azure-pipelines/getcontainer.sh +++ b/ci/getcontainer.sh @@ -18,18 +18,18 @@ fi DOCKER_CONTAINER="${GITHUB_REPOSITORY}/$(basename ${DOCKERFILE_PATH})" DOCKER_REGISTRY_CONTAINER="${DOCKER_REGISTRY}/${DOCKER_CONTAINER}" -echo "::set-env name=docker-container::${DOCKER_CONTAINER}" -echo "::set-env name=docker-registry-container::${DOCKER_REGISTRY_CONTAINER}" +echo "docker-container=${DOCKER_CONTAINER}" >> $GITHUB_ENV +echo "docker-registry-container=${DOCKER_REGISTRY_CONTAINER}" >> $GITHUB_ENV # Identify the last git commit that touched the Dockerfiles # Use this as a hash to identify the resulting docker containers DOCKER_SHA=$(git log -1 --pretty=format:"%h" -- "${DOCKERFILE_PATH}") -echo "::set-env name=docker-sha::${DOCKER_SHA}" +echo "docker-sha=${DOCKER_SHA}" >> $GITHUB_ENV DOCKER_REGISTRY_CONTAINER_SHA="${DOCKER_REGISTRY_CONTAINER}:${DOCKER_SHA}" -echo "::set-env name=docker-registry-container-sha::${DOCKER_REGISTRY_CONTAINER_SHA}" -echo "::set-env name=docker-registry-container-latest::${DOCKER_REGISTRY_CONTAINER}:latest" +echo "docker-registry-container-sha=${DOCKER_REGISTRY_CONTAINER_SHA}" >> $GITHUB_ENV +echo "docker-registry-container-latest=${DOCKER_REGISTRY_CONTAINER}:latest" >> $GITHUB_ENV exists="true" docker login https://${DOCKER_REGISTRY} -u ${GITHUB_ACTOR} -p ${GITHUB_TOKEN} || exists="false" @@ -39,7 +39,7 @@ if [ "${exists}" != "false" ]; then fi if [ "${exists}" = "true" ]; then - echo "::set-env name=docker-container-exists::true" + echo "docker-container-exists=true" >> $GITHUB_ENV else - echo "::set-env name=docker-container-exists::false" + echo "docker-container-exists=false" >> $GITHUB_ENV fi diff --git a/azure-pipelines/setup-mingw.sh b/ci/setup-mingw.sh index d500da058..d500da058 100755 --- a/azure-pipelines/setup-mingw.sh +++ b/ci/setup-mingw.sh diff --git a/azure-pipelines/setup-osx.sh b/ci/setup-osx.sh index 2e630eedb..2e630eedb 100755 --- a/azure-pipelines/setup-osx.sh +++ b/ci/setup-osx.sh diff --git a/azure-pipelines/test.sh b/ci/test.sh index 2b43ba198..2b43ba198 100755 --- a/azure-pipelines/test.sh +++ b/ci/test.sh |