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 DNM] try github actions for build checks #640

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
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
96 changes: 96 additions & 0 deletions .github/workflows/buildcheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Build checks

on: [push, pull_request]

jobs:
build-tarball:
name: Build tarball from GIT
runs-on: ubuntu-20.04
steps:
- name: Install dependencies
run: |
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: Build and distcheck
run: $GITHUB_WORKSPACE/.github/workflows/job-0-tarball.sh
- name: Archive tarballs
uses: actions/upload-artifact@v3
with:
name: Tarball
path: hwloc-*.tar.gz
- name: Archive documentation PDF
uses: actions/upload-artifact@v3
with:
name: Documentation PDF
path: doc/doxygen-doc/hwloc-a4.pdf
check-tarball-inria-centos81amd64:
name: Check tarball on Inria centos81amd64
needs: build-tarball
runs-on: hwloc-centos81amd64
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: '.github/workflows'
sparse-checkout-cone-mode: false
- name: Download tarball
uses: actions/download-artifact@v3
with:
name: Tarball
- name: Extract, build and check
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
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y --no-install-recommends pkg-config libcairo2-dev libxml2-dev
- run: ls -la
- uses: actions/checkout@v4
with:
sparse-checkout: '.github/workflows'
sparse-checkout-cone-mode: false
- run: ls -la
- name: Download tarball
uses: actions/download-artifact@v3
with:
name: Tarball
- name: Extract, build and check
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
runs-on: macos-latest
steps:
- name: Install dependencies
run: |
brew install pkg-config
brew install cairo
- uses: actions/checkout@v4
with:
sparse-checkout: '.github/workflows'
sparse-checkout-cone-mode: false
- name: Download tarball
uses: actions/download-artifact@v3
with:
name: Tarball
- name: Extract, build and check
run: |
$GITHUB_WORKSPACE/.github/workflows/job-1-check.sh hwloc-*.tar.gz
# check-tarball:
# name: Check tarball on GH runners
# needs: build-tarball
# strategy:
# matrix:
# os: [ubuntu-latest,macos-latest]
# runs-on: ${{ matrix.os }}
# steps:
# - name: Download tarball
# uses: actions/download-artifact@v3
# with:
# name: Tarball
# - name: Extract
# run: tar xvf hwloc-*.tar.gz
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,14 @@ echo "############################"
set -e
set -x

branch="$1"
if test -z "$branch"; then
echo "Need branch name as argument."
exit 1
fi

echo "Got GIT branch name $branch"

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

# convert "pr/XYZ/head" into "PR-XYZ"
branch=$(echo $branch | sed -r -e 's@pr/([0-9]+)/head@PR-\1@')
# GITHUB_REF contains refs/heads/<branch_name>, refs/pull/<pr_number>/merge, or refs/tags/<tag_name>
# convert into the branch/tag name or into "PR-XYZ"
branch=$(echo $GITHUB_REF | sed -r -e 's@refs/([^/]+)/@@' | sed -r -e 's@([0-9]+)/merge@PR-\1@')

# keep branch-name before the first - (e.g. v2.0-beta becomes v2.0)
# 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/-.*//' )
Expand All @@ -38,9 +31,6 @@ else
echo using generic $HOME/local/hwloc-master
fi

# remove previous artifacts so that they don't exported again by this build
rm -f hwloc-*.tar.gz hwloc-*.tar.bz2 || true

# display autotools versions
automake --version | head -1
libtool --version | head -1
Expand Down
2 changes: 1 addition & 1 deletion contrib/ci.inria.fr/job-1-check.sh → .github/workflows/job-1-check.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright © 2012-2020 Inria. All rights reserved.
# Copyright © 2012-2023 Inria. All rights reserved.
# See COPYING in top-level directory.
#

Expand Down
Loading