|
| 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 | + |
| 35 | + defaults: |
| 36 | + run: |
| 37 | + shell: 'bash' |
| 38 | + |
| 39 | + env: |
| 40 | + ARCH: ${{ matrix.arch }} |
| 41 | + PLATFORM: ${{ matrix.platform }} |
| 42 | + TARGET: ${{ matrix.arch }}-${{ matrix.platform }} |
| 43 | + SOURCE_PATH: ${{ matrix.platform == 'w64-mingw32' && '/usr/src/' || format('{0}/code', github.workspace) }} |
| 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: ${{ env.SOURCE_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 ${{ env.SOURCE_PATH }}/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: Build ${{ env.TARGET }} git |
| 77 | + run: | |
| 78 | + .github/scripts/git/build.sh |
| 79 | +
|
| 80 | + - name: Test ${{ env.TARGET }} git |
| 81 | + run: | |
| 82 | + .github/scripts/git/execute-tests.sh |
0 commit comments