Skip to content

Commit 951cd66

Browse files
committed
Allow compilation from all branches and tags
1 parent 8a82deb commit 951cd66

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,14 @@ jobs:
2222
python -m pip install --upgrade pip
2323
python -m pip install -e INCHI-1-TEST[invariance-tests]
2424
- name: Compile InChI library from triggering branch
25-
# https://github.com/actions/runner-images/issues/6775
2625
run: |
26+
git config --global --add safe.directory "$GITHUB_WORKSPACE" # https://github.com/actions/runner-images/issues/6775
2727
mkdir "$GITHUB_WORKSPACE/INCHI-1-TEST/libs"
28-
git config --global --add safe.directory "$GITHUB_WORKSPACE"
2928
./INCHI-1-TEST/compile_inchi_lib.sh ${{ github.ref_name }} "$GITHUB_WORKSPACE/INCHI-1-TEST/libs"
29+
if [ "${{ github.ref_name }}" != "main" ]; then
30+
# Rename library to libinchi.so.main, since that's the name the tests expect.
31+
mv "$GITHUB_WORKSPACE/INCHI-1-TEST/libs/libinchi.so.${{ github.ref_name }}" "$GITHUB_WORKSPACE/INCHI-1-TEST/libs/libinchi.so.main"
32+
fi
3033
- uses: ./.github/actions/regression_tests
3134
with:
3235
artifact-name: regression-test-results_glibc_gcc
@@ -65,11 +68,14 @@ jobs:
6568
python -m pip install --upgrade pip
6669
python -m pip install -e INCHI-1-TEST
6770
- name: Compile InChI library from triggering branch
68-
# https://github.com/actions/runner-images/issues/6775
6971
run: |
72+
git config --global --add safe.directory "$GITHUB_WORKSPACE" # https://github.com/actions/runner-images/issues/6775
7073
mkdir "$GITHUB_WORKSPACE/INCHI-1-TEST/libs"
71-
git config --global --add safe.directory "$GITHUB_WORKSPACE"
7274
./INCHI-1-TEST/compile_inchi_lib.sh ${{ github.ref_name }} "$GITHUB_WORKSPACE/INCHI-1-TEST/libs"
75+
if [ "${{ github.ref_name }}" != "main" ]; then
76+
# Rename library to libinchi.so.main, since that's the name the tests expect.
77+
mv "$GITHUB_WORKSPACE/INCHI-1-TEST/libs/libinchi.so.${{ github.ref_name }}" "$GITHUB_WORKSPACE/INCHI-1-TEST/libs/libinchi.so.main"
78+
fi
7379
- uses: ./.github/actions/regression_tests
7480
with:
7581
artifact-name: regression-test-results_musl_gcc

INCHI-1-TEST/compile_inchi_lib.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ cleanup() {
1818
# Register cleanup to be called on EXIT.
1919
trap cleanup EXIT
2020

21-
if [[ $inchi_version != "v1.05" && $inchi_version != "v1.06" && $inchi_version != "v1.07.0" && $inchi_version != "main" ]]; then
22-
echo "InChI version '$inchi_version' cannot be compiled."
23-
echo "Choose a version from 'v1.05', 'v1.06', 'v1.07.0', or 'main'."
24-
exit 1
25-
fi
26-
2721
if [ -n "$(git status --porcelain)" ]; then
2822
echo "There are uncommitted changes on the current branch."
2923
echo "Please commit or stash them before compiling '$inchi_version'."

0 commit comments

Comments
 (0)