|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + config: |
| 14 | + # Linux (amd64, Trusty, GCC, OpenSSL) |
| 15 | + - platform: 'ubuntu-latest' |
| 16 | + container: 'libgit2/trusty-amd64:latest' |
| 17 | + env: { CC: 'gcc', CMAKE_OPTIONS: '-DCRYPT=openssl -DUNICODE=builtin', LEAK_CHECK: 'valgrind' } |
| 18 | + |
| 19 | + # Linux (amd64, Trusty, GCC, mbedTLS) |
| 20 | + - platform: 'ubuntu-latest' |
| 21 | + container: 'libgit2/trusty-amd64:latest' |
| 22 | + env: { CC: 'gcc', CMAKE_OPTIONS: '-DCRYPT=mbedtls -DUNICODE=iconv', LEAK_CHECK: 'valgrind' } |
| 23 | + |
| 24 | + # Linux (amd64, Trusty, Clang, OpenSSL) |
| 25 | + - platform: 'ubuntu-latest' |
| 26 | + container: 'libgit2/trusty-amd64:latest' |
| 27 | + env: { CC: 'clang', CMAKE_OPTIONS: '-DCRYPT=openssl -DUNICODE=iconv', LEAK_CHECK: 'valgrind' } |
| 28 | + |
| 29 | + # Linux (amd64, Trusty, Clang, mbedTLS) |
| 30 | + - platform: 'ubuntu-latest' |
| 31 | + container: 'libgit2/trusty-amd64:latest' |
| 32 | + env: { CC: 'clang', CMAKE_OPTIONS: '-DCRYPT=mbedtls -DUNICODE=builtin', LEAK_CHECK: 'valgrind' } |
| 33 | + |
| 34 | + # Linux (x86, Bionic, gcc, OpenSSL) |
| 35 | + - platform: 'ubuntu-latest' |
| 36 | + container: 'libgit2/bionic-x86:latest' |
| 37 | + qemu: true |
| 38 | + env: { CC: 'gcc', CMAKE_OPTIONS: '-DCRYPT=openssl -DUNICODE=builtin', LEAK_CHECK: 'valgrind' } |
| 39 | + |
| 40 | + # Linux (x86, Bionic, clang, OpenSSL) |
| 41 | + - platform: 'ubuntu-latest' |
| 42 | + container: 'libgit2/bionic-x86:latest' |
| 43 | + qemu: true |
| 44 | + env: { CC: 'clang', CMAKE_OPTIONS: '-DCRYPT=openssl -DUNICODE=iconv', LEAK_CHECK: 'valgrind' } |
| 45 | + |
| 46 | + # Linux (arm32, Bionic, gcc, OpenSSL) |
| 47 | + - platform: 'ubuntu-latest' |
| 48 | + container: 'libgit2/bionic-arm32:latest' |
| 49 | + qemu: true |
| 50 | + env: { CC: 'gcc', CMAKE_OPTIONS: '-DCRYPT=openssl -DUNICODE=builtin' } |
| 51 | + |
| 52 | + # Linux (arm64, Bionic, gcc, OpenSSL) |
| 53 | + - platform: 'ubuntu-latest' |
| 54 | + container: 'libgit2/bionic-arm64:latest' |
| 55 | + qemu: true |
| 56 | + env: { CC: 'gcc', CMAKE_OPTIONS: '-DCRYPT=openssl -DUNICODE=builtin' } |
| 57 | + |
| 58 | + # macOS |
| 59 | + - platform: 'macos-latest' |
| 60 | + container: '' |
| 61 | + env: { LEAK_CHECK: 'leaks' } |
| 62 | + fail-fast: false |
| 63 | + |
| 64 | + runs-on: ${{ matrix.config.platform }} |
| 65 | + |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@v2 |
| 68 | + - name: Set up build environment |
| 69 | + run: docker run --rm --privileged multiarch/qemu-user-static:register --reset |
| 70 | + if: matrix.config.qemu == true |
| 71 | + - name: Build and test |
| 72 | + run: | |
| 73 | + if [ -n "${{ matrix.config.container }}" ]; then |
| 74 | + docker run -v $(pwd):/src -w /src -e CC -e CMAKE_GENERATOR -e CMAKE_OPTIONS -e PKG_CONFIG_PATH -e SKIP_SSH_TESTS -e SKIP_NEGOTIATE_TESTS ${{ matrix.config.container }} /bin/bash -c "mkdir build && cd build && ../ci/build.sh && ../ci/test.sh" |
| 75 | + else |
| 76 | + mkdir build && cd build |
| 77 | + ../ci/build.sh |
| 78 | + ../ci/test.sh |
| 79 | + fi |
0 commit comments