Skip to content

Commit 671ccc0

Browse files
lums658claude
andcommitted
Fix GitHub Actions workflow runner issues
- Update Linux workflow to use ubuntu-latest instead of ubuntu-20.04 (ubuntu-20.04 has limited runner availability causing 24h timeouts) - Update apt-key to use gpg keyring method (apt-key is deprecated) - Update Mac workflow to install gcc via homebrew (g++-11 not pre-installed) - Use dynamic gcc version detection on macOS - Update checkout actions to v4 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 6638caa commit 671ccc0

File tree

2 files changed

+31
-32
lines changed

2 files changed

+31
-32
lines changed

.github/workflows/build_cmake.yml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,40 @@
1-
# Workflow to configure with cmake and build with gcc-10
1+
# Workflow to configure with cmake and build with gcc
22

33
name: Build with gcc-11
44

55
on:
66
push:
77
branches: [ master, sc_release ]
8-
workflow_dispatch:
9-
8+
workflow_dispatch:
109

1110
env:
12-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1312

1413
jobs:
1514
build:
1615

17-
runs-on: ubuntu-20.04
16+
runs-on: ubuntu-latest
1817

1918
steps:
2019

2120
- name: Checkout NWgr
22-
uses: actions/checkout@v2
21+
uses: actions/checkout@v4
2322
with:
2423
path: NWgr
2524

26-
- name: prep
25+
- name: Install dependencies
2726
run: |
28-
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
29-
&& sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
30-
&& rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
31-
&& sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" \
32-
&& sudo apt-get update
33-
DEBIAN_FRONTEND=noninteractive \
34-
sudo apt-get -y install \
35-
intel-oneapi-tbb-devel
36-
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
37-
DEBIAN_FRONTEND=noninteractive \
38-
sudo apt-get -y install \
39-
gcc-11 \
40-
g++-11
27+
# Install Intel oneAPI TBB
28+
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
29+
| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
30+
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" \
31+
| sudo tee /etc/apt/sources.list.d/oneAPI.list
32+
sudo apt-get update
33+
DEBIAN_FRONTEND=noninteractive sudo apt-get -y install intel-oneapi-tbb-devel
34+
# Install gcc-11 (available on ubuntu-22.04+)
35+
DEBIAN_FRONTEND=noninteractive sudo apt-get -y install gcc-11 g++-11
4136
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 90 --slave /usr/bin/g++ g++ /usr/bin/g++-11
42-
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
37+
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
4338
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
4439
4540
- name: cmake

.github/workflows/build_cmake_mac.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# Workflow to configure with cmake and build with gcc-10
1+
# Workflow to configure with cmake and build with gcc
22

3-
name: Build with gcc-11 (Mac)
3+
name: Build with gcc (Mac)
44

55
on:
6-
push:
6+
push:
77
branches: [ master, sc_release ]
8-
workflow_dispatch:
8+
workflow_dispatch:
99

1010
# pull_request:
1111
# branches:
1212
# - '*'
1313

1414
env:
15-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1616

1717
jobs:
1818
build:
@@ -22,23 +22,27 @@ jobs:
2222
steps:
2323

2424
- name: Checkout NWgr
25-
uses: actions/checkout@v2
25+
uses: actions/checkout@v4
2626
with:
2727
path: NWgr
2828

29-
# The macos image evidently has gcc-11 and cmake 3.22 pre-installed
30-
- name: prep
29+
- name: Install dependencies
3130
run: |
3231
brew update
33-
brew install tbb
32+
brew install gcc tbb
3433
3534
- name: cmake
3635
run: |
3736
cd NWgr
3837
mkdir build
3938
cd build
40-
export TBBROOT=/opt/intel/oneapi/tbb/latest
41-
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_COMPILER=g++-11 -DNWGRAPH_BUILD_DOCS=OFF -DNWGRAPH_BUILD_TESTS=ON
39+
# Find the highest gcc version installed by homebrew
40+
GCC_VERSION=$(ls /opt/homebrew/bin/g++-* 2>/dev/null | grep -o '[0-9]*$' | sort -n | tail -1)
41+
if [ -z "$GCC_VERSION" ]; then
42+
GCC_VERSION=$(ls /usr/local/bin/g++-* 2>/dev/null | grep -o '[0-9]*$' | sort -n | tail -1)
43+
fi
44+
echo "Using g++-$GCC_VERSION"
45+
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_COMPILER=g++-$GCC_VERSION -DNWGRAPH_BUILD_DOCS=OFF -DNWGRAPH_BUILD_TESTS=ON
4246
4347
- name: make
4448
run: |

0 commit comments

Comments
 (0)