Skip to content

Commit 4f218c2

Browse files
committed
Extract action for InChI compilation
1 parent 951cd66 commit 4f218c2

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Compile InChI library from triggering branch
2+
3+
runs:
4+
using: "composite"
5+
steps:
6+
- run: |
7+
git config --global --add safe.directory "$GITHUB_WORKSPACE" # https://github.com/actions/runner-images/issues/6775
8+
mkdir "$GITHUB_WORKSPACE/$LIB_DIR"
9+
./INCHI-1-TEST/compile_inchi_lib.sh $BRANCH "$GITHUB_WORKSPACE/$LIB_DIR"
10+
if [ "$BRANCH" != "main" ]; then
11+
# Rename library to libinchi.so.main, since that's the name the tests expect.
12+
mv "$GITHUB_WORKSPACE/$LIB_DIR/libinchi.so.$BRANCH" "$GITHUB_WORKSPACE/$LIB_DIR/libinchi.so.main"
13+
fi
14+
shell: bash
15+
env:
16+
BRANCH: ${{ github.ref_name }}
17+
LIB_DIR: INCHI-1-TEST/libs

.github/workflows/ci.yml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,7 @@ jobs:
2121
run: |
2222
python -m pip install --upgrade pip
2323
python -m pip install -e INCHI-1-TEST[invariance-tests]
24-
- name: Compile InChI library from triggering branch
25-
run: |
26-
git config --global --add safe.directory "$GITHUB_WORKSPACE" # https://github.com/actions/runner-images/issues/6775
27-
mkdir "$GITHUB_WORKSPACE/INCHI-1-TEST/libs"
28-
./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
24+
- uses: ./.github/actions/compile_inchi_lib
3325
- uses: ./.github/actions/regression_tests
3426
with:
3527
artifact-name: regression-test-results_glibc_gcc
@@ -67,15 +59,7 @@ jobs:
6759
run: |
6860
python -m pip install --upgrade pip
6961
python -m pip install -e INCHI-1-TEST
70-
- name: Compile InChI library from triggering branch
71-
run: |
72-
git config --global --add safe.directory "$GITHUB_WORKSPACE" # https://github.com/actions/runner-images/issues/6775
73-
mkdir "$GITHUB_WORKSPACE/INCHI-1-TEST/libs"
74-
./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
62+
- uses: ./.github/actions/compile_inchi_lib
7963
- uses: ./.github/actions/regression_tests
8064
with:
8165
artifact-name: regression-test-results_musl_gcc

0 commit comments

Comments
 (0)