Skip to content

Commit deccf49

Browse files
committed
Github Actions test workflow
1 parent e44f56f commit deccf49

File tree

4 files changed

+74
-7
lines changed

4 files changed

+74
-7
lines changed

.github/dependabot.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"

.github/workflows/test.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'cspice-sharedlib.sh'
9+
- '.github/workflows/test.yml'
10+
11+
pull_request:
12+
paths:
13+
- 'cspice-sharedlib.sh'
14+
- '.github/workflows/test.yml'
15+
16+
jobs:
17+
18+
build:
19+
name: Test build
20+
21+
runs-on: ubuntu-latest
22+
env:
23+
CC: gcc
24+
CFLAGS: -Os -Wall -Wextra -Werror -std=c99
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Install csh
29+
run: sudo apt-get install csh
30+
31+
- name: Get CSPICE Toolkit
32+
run: wget https://naif.jpl.nasa.gov/pub/naif/misc/toolkit_N0067/C/PC_Linux_GCC_64bit/packages/cspice.tar.Z
33+
34+
- name: Unpack CSPICE
35+
run: tar -xf cspice.tar.Z
36+
37+
- name: Build CSPICE
38+
env:
39+
CFLAGS: -O2
40+
run: ./cspice-sharedlib.sh
41+
42+
- name: List library files
43+
run: ls -l cspice/lib/
44+
45+
- name: List executables
46+
run: ls -l cspice/exe/
47+
48+
49+

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
![Test Status](https://github.com/Smithsonian/cspice-sharedlib/actions/workflows/test.yml/badge.svg)
2+
13
# cspice-sharedlib
24

3-
Shell script to build the NAIF CSPICE Toolkit with shared (`.so`) libraries, and dynamic linking
4-
instead of the normal static libraries and static linking of the distribution.
5+
Shell script to build the NAIF CSPICE Toolkit with shared (`.so`) libraries, and dynamically link
6+
executable instead of the normal static libraries and static linking of the upstream distribution.
57

68
Author: Attila Kovacs `<attila.kovacs[AT]cfa.harvard.edu>`
79
Version: 0.9

cspice-sharedlib.sh

+10-5
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,21 @@ cd ..
6464
# ----------------------------------------------------------------------------
6565
# Additional compiler flags we need.
6666
# It's an old library, with parts converted from FORTRAN.
67-
# Some functions do not declare a return value, so we must allow implitic-int
68-
# and also other compat flags since we do not control the source code.
69-
CFLAGS="$CFLAGS -ansi -DNON_UNIX_STDIO -Wno-implicit-int -fno-strict-aliasing"
67+
# So, we'll suppress warnings, as there is nothing we can do about them anyway.
68+
CFLAGS="$CFLAGS -Wno-error -w -ansi -DNON_UNIX_STDIO"
7069

7170
# Flags for linking shared libraries
7271
SO_LINK="-shared -fPIC -Wl,-soname,libcspice.so.1 $LDFLAGS -lm"
7372

7473
# ----------------------------------------------------------------------------
7574
echo "Building lib/libcspice.so.1..."
7675

76+
echo " CPPFLAGS = $CPPFLAGS"
77+
echo " CFLAGS = $CFLAGS"
78+
echo " LDFLAGS = $LDFLAGS"
79+
7780
# Build shared lib first (our way)
78-
gcc -o lib/libcspice.so.1 src/cspice/*.c src/csupport/*.c $CPPFLAGS $CFLAGS $SO_LINK
81+
gcc $CFLAGS -o lib/libcspice.so.1 src/cspice/*.c src/csupport/*.c $SO_LINK
7982

8083
# ----------------------------------------------------------------------------
8184
# Create unversion .so symlink
@@ -103,7 +106,9 @@ echo "Restoring original build scripts..."
103106
for component in * ; do
104107
if [ -f $component/mkproduct.bak ] ; then
105108
# back up the build script
106-
mv $component/mkprodct.bak $component/mkprodct.csh
109+
mv $component/mkprodct.bak $component/mkprodct.csh
110+
fi
111+
done
107112

108113
echo "All done."
109114

0 commit comments

Comments
 (0)