Skip to content

Commit

Permalink
Add workflow for git testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackhex committed Feb 2, 2025
1 parent c85d700 commit b54793e
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 2 deletions.
27 changes: 27 additions & 0 deletions .github/scripts/git/install-dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

source `dirname ${BASH_SOURCE[0]}`/config.sh

echo "::group::Install Dependencies"
sudo apt update
sudo apt install -y \
asciidoc \
autotools-dev \
build-essential \
ccache \
docbook-xml \
docbook-xsl \
gcc \
less \
libexpat1-dev \
libc6-dev \
libcurl4-openssl-dev \
gettext \
libpcre2-dev \
python3 \
rsync \
texinfo \
xmlto
echo "::endgroup::"

echo 'Success!'
1 change: 0 additions & 1 deletion .github/workflows/advanced.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
pull_request:
workflow_dispatch:
inputs:
binutils_branch:
Expand Down
94 changes: 94 additions & 0 deletions .github/workflows/git.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Build and test git

on:
pull_request:
workflow_dispatch:
inputs:
git_branch:
description: 'Git branch to build'
required: false
default: 'v2.47.1'
git_revision:
description: 'Git for Windows revision to build'
required: false
default: 'windows.2'

env:
GIT_REPO: git/git
GIT_BRANCH: ${{ github.event.inputs.git_branch || 'v2.47.1' }}
GIT_REVISION: ${{ github.event.inputs.git_revision || 'windows.2' }}

jobs:
build-and-test-git:
name: Build and test git
runs-on: ${{ matrix.platform == 'w64-mingw32' && 'windows-latest' || 'ubuntu-latest' }}

strategy:
fail-fast: false
matrix:
arch: [aarch64, x86_64]
platform: [w64-mingw32, pc-linux-gnu, pc-cygwin]
exclude:
- arch: aarch64
- platform: pc-cygwin
- platform: pc-linux-gnu

defaults:
run:
shell: 'bash'

env:
ARCH: ${{ matrix.arch }}
PLATFORM: ${{ matrix.platform }}
TARGET: ${{ matrix.arch }}-${{ matrix.platform }}

steps:
- name: Setup Git for Windows SDK
if: ${{ env.PLATFORM == 'w64-mingw32' }}
uses: git-for-windows/setup-git-for-windows-sdk@v1
with:
flavor: full

- name: Checkout repository
uses: actions/checkout@v4

- name: Checkout git repository (pc-linux-gnu)
if: ${{ env.PLATFORM == 'pc-linux-gnu' }}
uses: actions/checkout@v4
with:
repository: ${{ env.GIT_REPO }}
ref: ${{ env.GIT_BRANCH }}
path: git

- name: Checkout git repository (w64-mingw32)
if: ${{ env.PLATFORM == 'w64-mingw32' }}
run: |
/git-bash.exe -c sdk init git
cd /usr/src/git
git fetch --all
git checkout ${{ env.GIT_BRANCH }}.${{ env.GIT_REVISION }}
- name: Install dependencies
if: ${{ env.PLATFORM == 'pc-linux-gnu' }}
run: |
.github/scripts/git/install-dependencies.sh
- name: Test
run: |
pwd
ls -al
- name: Build ${{ env.TARGET }} git
working-directory: ${{ env.PLATFORM == 'pc-linux-gnu' && 'git' || '' }}
run: |
cd /usr/src/git
make -j$(nproc)
- name: Test ${{ env.TARGET }} git
working-directory: ${{ env.PLATFORM == 'pc-linux-gnu' && 'git' || '' }}
run: |
cd /usr/src/git
make \
DEFAULT_TEST_TARGET=prove \
GIT_PROVE_OPTS='--timer --jobs $(nproc) --state=failed,save' \
test
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
pull_request:
workflow_dispatch:
inputs:
binutils_branch:
Expand Down

0 comments on commit b54793e

Please sign in to comment.