Replace Travis for continuous integration with Github Actions. The Github Actions pipeline is functionally equivalent, with all the same build permutations supported. Whilst the Github Actions offering is broadly equivalent to Travis, a few changes have been made as part of the migration. - The 'core' and 'optional' Travis stages have been consolidated into one build matrix. This is due to the current inability in Github Actions to share build steps between jobs, so this avoids having to duplicate the steps. Optional stage jobs will now run in parallel with core jobs, but they still remain optional in the sense that they don't fail the build. - A number of existing Github Action plugins are used to replace functionality provided by Travis or other tools: Node setup, caching, Codecov, publishing release artifacts. - Linux builds are updated to build on Ubuntu 18.04. MacOS builds are updated to run on 10.15. Similar to the Travis Xenial upgrade attempt, some changes are required due to underlying platform and compiler upgrades. This means some Node 10 toolchains will no longer be supported. Whilst there is opportunity to upgrade some dependencies and make the CI steps more idiomatic, I've left this for future changes and just focussed on functional replication.
38 lines
1.0 KiB
Bash
Executable File
38 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -eu
|
|
set -o pipefail
|
|
|
|
echo "node version is:"
|
|
which node
|
|
node -v
|
|
|
|
if [[ ${PUBLISH} == 'On' ]]; then
|
|
echo "PUBLISH is set to '${PUBLISH}', publishing!"
|
|
NPM_FLAGS=''
|
|
if [[ ${BUILD_TYPE} == "Debug" ]]; then
|
|
NPM_FLAGS='--debug'
|
|
fi
|
|
|
|
echo "dumping binary meta..."
|
|
./node_modules/.bin/node-pre-gyp reveal $NPM_FLAGS
|
|
|
|
# enforce that binary has proper ORIGIN flags so that
|
|
# it can portably find libtbb.so in the same directory
|
|
if [[ $(uname -s) == 'Linux' ]]; then
|
|
readelf -d ./lib/binding/node_osrm.node > readelf-output.txt
|
|
if grep -q 'Flags: ORIGIN' readelf-output.txt; then
|
|
echo "Found ORIGIN flag in readelf output"
|
|
cat readelf-output.txt
|
|
else
|
|
echo "*** Error: Could not found ORIGIN flag in readelf output"
|
|
cat readelf-output.txt
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
./node_modules/.bin/node-pre-gyp package testpackage $NPM_FLAGS
|
|
else
|
|
echo "PUBLISH is set to '${PUBLISH}', skipping."
|
|
fi
|