Skip to content

Commit 9eb9974

Browse files
authored
fix ABI diff workflow not running on github runners (#66)
* try fix github runners * setup_tools
1 parent 5d6e686 commit 9eb9974

1 file changed

Lines changed: 57 additions & 6 deletions

File tree

.github/workflows/abi-diff.yml

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ on:
1111
cxx:
1212
type: string
1313
default: clang++-20
14+
cmake-version:
15+
type: string
16+
default: 3.21.7
17+
conan-version:
18+
type: string
19+
default: 2.23.0
20+
setup_tools:
21+
type: boolean
22+
default: false
1423

1524
# Branch to compare to
1625
base-branch:
@@ -51,6 +60,48 @@ jobs:
5160
shell: bash
5261
runs-on: ${{ inputs.os }}
5362
steps:
63+
- name: Add repos for for gcc-13 and clang-16,17
64+
if: inputs.setup_tools
65+
uses: dice-group/cpp-conan-release-reusable-workflow/.github/actions/setup_apt@main
66+
67+
- name: Get minimum cmake version
68+
if: inputs.setup_tools
69+
uses: lukka/get-cmake@v3.29.6
70+
with:
71+
cmakeVersion: ${{ inputs.cmake-version }}
72+
73+
- name: Install compiler
74+
if: inputs.setup_tools
75+
id: install_cc
76+
uses: rlalik/setup-cpp-compiler@v1.2
77+
with:
78+
compiler: ${{ inputs.cc }}
79+
80+
- name: Set compiler env installed
81+
if: inputs.setup_tools
82+
run: |
83+
echo "CC=${{ steps.install_cc.outputs.cc }}" >> $GITHUB_ENV
84+
echo "CXX=${{ steps.install_cc.outputs.cxx }}" >> $GITHUB_ENV
85+
86+
- name: Set compiler env preinstalled
87+
if: inputs.setup_tools == false
88+
run: |
89+
echo "CC=${{ inputs.cc }}" >> $GITHUB_ENV
90+
echo "CXX=${{ inputs.cxx }}" >> $GITHUB_ENV
91+
92+
- name: Install conan
93+
if: inputs.setup_tools
94+
uses: dice-group/cpp-conan-release-reusable-workflow/.github/actions/configure_conan@main
95+
with:
96+
conan-version: ${{ inputs.conan-version }}
97+
98+
- name: Add conan remotes
99+
if: inputs.setup_tools
100+
run: |
101+
conan remote add dice-group https://conan.dice-research.org/artifactory/api/conan/tentris
102+
103+
conan remote add tentris-private https://conan.dice-research.org/artifactory/api/conan/tentris-private
104+
54105
- name: Conan login
55106
run: |
56107
conan remote login -p "${{ secrets.CONAN_PW }}" tentris-private "${{ secrets.CONAN_USER }}"
@@ -99,15 +150,15 @@ jobs:
99150
- name: Generate version file on feature branch
100151
uses: dice-group/cpp-conan-release-reusable-workflow/.github/actions/generate_version_file@main
101152
with:
102-
cc: ${{ inputs.cc }}
103-
cxx: ${{ inputs.cxx }}
153+
cc: ${{ env.CC }}
154+
cxx: ${{ env.CXX }}
104155
build-dir: build_dir
105156
target: ${{ inputs.abi-version-cmake-target }}
106157

107158
- name: Fetch current ABI version
108159
id: current-abi-version
109160
run: |
110-
${{ inputs.cxx }} -std=c++20 -I. -o /tmp/detect-abi-version-current /tmp/detect-abi-version.cpp
161+
${{ env.CXX }} -std=c++20 -I. -o /tmp/detect-abi-version-current /tmp/detect-abi-version.cpp
111162
abi_version=$(/tmp/detect-abi-version-current)
112163
113164
echo "Current ABI version: $abi_version"
@@ -121,15 +172,15 @@ jobs:
121172
- name: Regenerate version file for base branch
122173
uses: dice-group/cpp-conan-release-reusable-workflow/.github/actions/generate_version_file@main
123174
with:
124-
cc: ${{ inputs.cc }}
125-
cxx: ${{ inputs.cxx }}
175+
cc: ${{ env.CC }}
176+
cxx: ${{ env.CXX }}
126177
build-dir: build_dir
127178
target: ${{ inputs.abi-version-cmake-target }}
128179

129180
- name: Fetch base branch ABI version
130181
id: base-abi-version
131182
run: |
132-
${{ inputs.cxx }} -std=c++20 -I. -o /tmp/detect-abi-version-base /tmp/detect-abi-version.cpp
183+
${{ env.CXX }} -std=c++20 -I. -o /tmp/detect-abi-version-base /tmp/detect-abi-version.cpp
133184
abi_version=$(/tmp/detect-abi-version-base)
134185
135186
echo "Base ABI version: $abi_version"

0 commit comments

Comments
 (0)