|
| 1 | +name: Build and test git |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + git_branch: |
| 8 | + description: 'Git branch to build' |
| 9 | + required: false |
| 10 | + default: 'v2.47.1' |
| 11 | + git_revision: |
| 12 | + description: 'Git for Windows revision to build' |
| 13 | + required: false |
| 14 | + default: 'windows.2' |
| 15 | + |
| 16 | +env: |
| 17 | + GIT_REPO: git/git |
| 18 | + GIT_BRANCH: ${{ github.event.inputs.git_branch || 'v2.47.1' }} |
| 19 | + GIT_REVISION: ${{ github.event.inputs.git_revision || 'windows.2' }} |
| 20 | + |
| 21 | +jobs: |
| 22 | + build-and-test-git: |
| 23 | + name: Build and test git |
| 24 | + runs-on: ${{ matrix.platform == 'w64-mingw32' && 'windows-latest' || 'ubuntu-latest' }} |
| 25 | + |
| 26 | + strategy: |
| 27 | + fail-fast: false |
| 28 | + matrix: |
| 29 | + arch: [aarch64, x86_64] |
| 30 | + platform: [w64-mingw32, pc-linux-gnu, pc-cygwin] |
| 31 | + exclude: |
| 32 | + - arch: aarch64 |
| 33 | + - platform: pc-cygwin |
| 34 | + - platform: pc-linux-gnu |
| 35 | + |
| 36 | + defaults: |
| 37 | + run: |
| 38 | + shell: 'bash' |
| 39 | + |
| 40 | + env: |
| 41 | + ARCH: ${{ matrix.arch }} |
| 42 | + PLATFORM: ${{ matrix.platform }} |
| 43 | + TARGET: ${{ matrix.arch }}-${{ matrix.platform }} |
| 44 | + |
| 45 | + steps: |
| 46 | + - name: Setup Git for Windows SDK |
| 47 | + if: ${{ env.PLATFORM == 'w64-mingw32' }} |
| 48 | + uses: git-for-windows/setup-git-for-windows-sdk@v1 |
| 49 | + with: |
| 50 | + flavor: full |
| 51 | + |
| 52 | + - name: Checkout repository |
| 53 | + uses: actions/checkout@v4 |
| 54 | + |
| 55 | + - name: Checkout git repository (pc-linux-gnu) |
| 56 | + if: ${{ env.PLATFORM == 'pc-linux-gnu' }} |
| 57 | + uses: actions/checkout@v4 |
| 58 | + with: |
| 59 | + repository: ${{ env.GIT_REPO }} |
| 60 | + ref: ${{ env.GIT_BRANCH }} |
| 61 | + path: git |
| 62 | + |
| 63 | + - name: Checkout git repository (w64-mingw32) |
| 64 | + if: ${{ env.PLATFORM == 'w64-mingw32' }} |
| 65 | + run: | |
| 66 | + /git-bash.exe -c sdk init git |
| 67 | + cd /usr/src/git |
| 68 | + git fetch --all |
| 69 | + git checkout ${{ env.GIT_BRANCH }}.${{ env.GIT_REVISION }} |
| 70 | +
|
| 71 | + - name: Install dependencies |
| 72 | + if: ${{ env.PLATFORM == 'pc-linux-gnu' }} |
| 73 | + run: | |
| 74 | + .github/scripts/git/install-dependencies.sh |
| 75 | +
|
| 76 | + - name: Test |
| 77 | + run: | |
| 78 | + pwd |
| 79 | + ls -al |
| 80 | +
|
| 81 | + - name: Build ${{ env.TARGET }} git |
| 82 | + working-directory: ${{ env.PLATFORM == 'pc-linux-gnu' && 'git' || '' }} |
| 83 | + run: | |
| 84 | + /git-bash.exe -c true |
| 85 | + make -j$(nproc) |
| 86 | +
|
| 87 | + - name: Test ${{ env.TARGET }} git |
| 88 | + working-directory: ${{ env.PLATFORM == 'pc-linux-gnu' && 'git' || '' }} |
| 89 | + run: | |
| 90 | + /git-bash.exe -c true |
| 91 | + make \ |
| 92 | + DEFAULT_TEST_TARGET=prove \ |
| 93 | + GIT_PROVE_OPTS='--timer --jobs $(nproc) --state=failed,save' \ |
| 94 | + test |
0 commit comments