Skip to content

Commit

Permalink
reuse ci.inria.fr job-0-tarball.sh
Browse files Browse the repository at this point in the history
Signed-off-by: Brice Goglin <[email protected]>
  • Loading branch information
bgoglin committed Nov 29, 2023
1 parent fb7772d commit e3c7155
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 17 deletions.
21 changes: 4 additions & 17 deletions .github/workflows/buildcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,8 @@ jobs:
sudo apt-get update
sudo apt-get install -y --no-install-recommends libltdl-dev libcairo2-dev libx11-dev libxml2-dev libxml2-utils libncurses5-dev libxnvctrl-dev libpciaccess-dev libudev-dev pkg-config ocl-icd-opencl-dev autoconf automake libtool doxygen-latex transfig w3m
- uses: actions/checkout@v4
- name: Autogen
run: ./autogen.sh
- name: Configure
run: ./configure --prefix=${PWD}/install
- name: Build
run: make -j
- name: Distcheck
run: make distcheck
- name: Check versions
run: |
contrib/windows/check-versions.sh
contrib/windows-cmake/check-versions.sh
contrib/android/check-versions.sh
- name: Build and distcheck
run: $GITHUB_WORKSPACE/.github/workflows/job-0-tarball.sh
- name: Archive tarballs
uses: actions/upload-artifact@v3
with:
Expand All @@ -49,8 +38,7 @@ jobs:
with:
name: Tarball
- name: Extract, build and check
run: |
$GITHUB_WORKSPACE/.github/workflows/job-1-check.sh hwloc-*.tar.gz
run: $GITHUB_WORKSPACE/.github/workflows/job-1-check.sh hwloc-*.tar.gz
check-tarball-gh-ubuntu-latest:
name: Check tarball on GH ubuntu-latest
needs: build-tarball
Expand All @@ -69,8 +57,7 @@ jobs:
with:
name: Tarball
- name: Extract, build and check
run: |
$GITHUB_WORKSPACE/.github/workflows/job-1-check.sh hwloc-*.tar.gz
run: $GITHUB_WORKSPACE/.github/workflows/job-1-check.sh hwloc-*.tar.gz
check-tarball-gh-macos-latest:
name: Check tarball on GH macos-latest
needs: build-tarball
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/job-0-tarball.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/bin/sh
#
# Copyright © 2012-2023 Inria. All rights reserved.
# See COPYING in top-level directory.
#

echo "############################"
echo "Running on:"
uname -a
echo "############################"

set -e
set -x

# environment variables
test -f $HOME/.ciprofile && . $HOME/.ciprofile

branch=$(git branch --show-current)

echo "Got GIT branch name $branch"

# convert "refs/remotes/pull/XYZ/merge" into "PR-XYZ"
branch=$(echo $branch | sed -r -e 's@refs/remotes/pull/([0-9]+)/mergepr/@PR-\1@')

# keep branch-name before the first '-' (e.g. v2.0-beta becomes v2.0)
# and look for the corresponding autotools.
# "PR-XYZ" will get "PR" which means they'll use master autotools (likely OK)
basebranch=$( echo $branch | sed -r -e 's@^.*/([^/]+)$@\1@' -e 's/-.*//' )
if test -d $HOME/local/hwloc-$basebranch ; then
export PATH=$HOME/local/hwloc-${basebranch}/bin:$PATH
echo using specific $HOME/local/hwloc-$basebranch
else
export PATH=$HOME/local/hwloc-master/bin:$PATH
echo using generic $HOME/local/hwloc-master
fi

# display autotools versions
automake --version | head -1
libtool --version | head -1
autoconf --version | head -1

# better version string
snapshot=$branch-`date --utc +%Y%m%d.%H%M`.git`git show --format=format:%h -s`
sed -e 's/^snapshot_version=.*/snapshot_version='$snapshot/ \
-e 's/^snapshot=.*/snapshot=1/' \
-i VERSION

# let's go
./autogen.sh
./configure
make

if test x$NO_CHECK = xtrue; then
distcheck=dist
else
distcheck=distcheck
fi
if ! make $distcheck; then
# make distcheck temporarily sets the source directory as R/O.
# a failure during that R/O step may cause git clean -fdx to fail during the next build
chmod u+w -R .
false
fi

# Only check versions once in the main job.
# Some of these tests require bash and grep -P anyway.
contrib/windows/check-versions.sh
contrib/windows-cmake/check-versions.sh
contrib/android/check-versions.sh

exit 0

0 comments on commit e3c7155

Please sign in to comment.