Skip to content

Commit b2986f9

Browse files
committed
Add workflow for git testing
1 parent c85d700 commit b2986f9

File tree

4 files changed

+121
-2
lines changed

4 files changed

+121
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
gettext \
20+
libpcre2-dev \
21+
python3 \
22+
rsync \
23+
texinfo \
24+
xmlto
25+
echo "::endgroup::"
26+
27+
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

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

.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)