Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add workflow for git testing #253

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/scripts/git/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

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

cd $SOURCE_PATH/git

echo "::group::Build git"
make $BUILD_MAKE_OPTIONS
echo "::endgroup::"

if [[ "$RUN_INSTALL" = 1 ]]; then
echo "::group::Install git"
make install
echo "::endgroup::"
fi

echo 'Success!'
14 changes: 14 additions & 0 deletions .github/scripts/git/execute-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

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

cd $SOURCE_PATH/git

echo "::group::Execute git tests"
make \
DEFAULT_TEST_TARGET=prove \
GIT_PROVE_OPTS="--timer --jobs $(nproc) --state=failed,save" \
test
echo "::endgroup::"

echo 'Success!'
28 changes: 28 additions & 0 deletions .github/scripts/git/install-dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/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 \
libssl-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
82 changes: 82 additions & 0 deletions .github/workflows/git.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
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

defaults:
run:
shell: 'bash'

env:
ARCH: ${{ matrix.arch }}
PLATFORM: ${{ matrix.platform }}
TARGET: ${{ matrix.arch }}-${{ matrix.platform }}
SOURCE_PATH: ${{ matrix.platform == 'w64-mingw32' && '/usr/src/' || format('{0}/code', github.workspace) }}

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: ${{ env.SOURCE_PATH }}/git

- name: Checkout git repository (w64-mingw32)
if: ${{ env.PLATFORM == 'w64-mingw32' }}
run: |
/git-bash.exe -c sdk init git
cd ${{ env.SOURCE_PATH }}/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: Build ${{ env.TARGET }} git
run: |
.github/scripts/git/build.sh

- name: Test ${{ env.TARGET }} git
run: |
.github/scripts/git/execute-tests.sh
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
Loading