Skip to content

Commit 069b8d2

Browse files
committed
Add workflow for git testing
1 parent f4f5913 commit 069b8d2

File tree

6 files changed

+141
-2
lines changed

6 files changed

+141
-2
lines changed

.github/scripts/git/build.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
source `dirname ${BASH_SOURCE[0]}`/../config.sh
4+
5+
cd $SOURCE_PATH/git
6+
7+
echo "::group::Build git"
8+
make $BUILD_MAKE_OPTIONS
9+
echo "::endgroup::"
10+
11+
if [[ "$RUN_INSTALL" = 1 ]]; then
12+
echo "::group::Install git"
13+
make install
14+
echo "::endgroup::"
15+
fi
16+
17+
echo 'Success!'

.github/scripts/git/execute-tests.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
source `dirname ${BASH_SOURCE[0]}`/../config.sh
4+
5+
cd $SOURCE_PATH/git
6+
7+
echo "::group::Execute git tests"
8+
make \
9+
DEFAULT_TEST_TARGET=prove \
10+
GIT_PROVE_OPTS="--timer --jobs $(nproc) --state=failed,save" \
11+
test
12+
echo "::endgroup::"
13+
14+
echo 'Success!'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
source `dirname ${BASH_SOURCE[0]}`/config.sh
4+
5+
echo "::group::Install Dependencies"
6+
sudo apt update
7+
sudo apt install -y \
8+
asciidoc \
9+
autotools-dev \
10+
build-essential \
11+
ccache \
12+
docbook-xml \
13+
docbook-xsl \
14+
gcc \
15+
less \
16+
libexpat1-dev \
17+
libc6-dev \
18+
libcurl4-openssl-dev \
19+
libssl-dev \
20+
gettext \
21+
libpcre2-dev \
22+
python3 \
23+
rsync \
24+
texinfo \
25+
xmlto
26+
echo "::endgroup::"
27+
28+
echo 'Success!'

.github/workflows/advanced.yml

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
pull_request:
87
workflow_dispatch:
98
inputs:
109
binutils_branch:

.github/workflows/git.yml

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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

.github/workflows/main.yml

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
pull_request:
87
workflow_dispatch:
98
inputs:
109
binutils_branch:

0 commit comments

Comments
 (0)