From ccd567d24285f2c001d89464cd482e417e1a615f Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Mon, 20 Jul 2020 12:22:51 -0700 Subject: [PATCH] hardcode script paths Signed-off-by: Louise Poubel --- README.md | 14 +++++++++----- action.yml | 20 -------------------- entrypoint.sh | 15 ++++++--------- 3 files changed, 15 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 6de819a..f0f7308 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,7 @@ jobs: with: apt-dependencies: '' codecov-token: ${{ secrets.CODECOV_TOKEN }} - script-before-cmake: before_cmake.sh cmake-args: '-DBUILD_TESTING=1' - script-between-cmake-make: between_cmake_make.sh - script-after-make: after_make.sh - script-after-make-test: after_make_test.sh ``` ### Dependencies @@ -47,7 +43,15 @@ Create a secret on the repository with Codecov's token, called `CODECOV_TOKEN`. ### Custom scripts -The `script-`s are optional hooks that you can run at specific times of the build. +You can add optional scripts to be run at specific times of the build: + +* `.github/ci-bionic/before_cmake.sh`: Runs before the `cmake` call +* `.github/ci-bionic/between_cmake_make.sh`: Runs after the `cmake` and before `make` +* `.github/ci-bionic/after_make.sh`: Runs after `make` and before `make test` +* `.github/ci-bionic/after_make_test.sh`: Runs after `make test` + +All scripts are sourced inside the build folder. Be sure to move back to the +build folder before exiting the script. ### Custom CMake Arguments diff --git a/action.yml b/action.yml index 2bb83ae..aad6487 100644 --- a/action.yml +++ b/action.yml @@ -13,34 +13,14 @@ inputs: description: 'Token to upload to Codecov' required: false default: '' - script-before-cmake: - description: 'Bash script to be run before cmake inside the build folder' - required: false - default: '' cmake-args: description: 'Additional CMake arguments to use when building package under test' required: false default: '' - script-between-cmake-make: - description: 'Bash script to be run after cmake and before make inside the build folder' - required: false - default: '' - script-after-make: - description: 'Bash script to be run after make and before make test inside the build folder' - required: false - default: '' - script-after-make-test: - description: 'Bash script to be run after make test inside the build folder' - required: false - default: '' runs: using: 'docker' image: 'Dockerfile' args: - ${{ inputs.apt-dependencies }} - ${{ inputs.codecov-token }} - - ${{ inputs.script-before-cmake }} - ${{ inputs.cmake-args }} - - ${{ inputs.script-between-cmake-make }} - - ${{ inputs.script-after-make }} - - ${{ inputs.script-after-make-test }} diff --git a/entrypoint.sh b/entrypoint.sh index 1891db2..5349abb 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,11 +5,12 @@ set -e APT_DEPENDENCIES=$1 CODECOV_TOKEN=$2 -SCRIPT_BEFORE_CMAKE=$3 -CMAKE_ARGS=$4 -SCRIPT_BETWEEN_CMAKE_MAKE=$5 -SCRIPT_AFTER_MAKE=$6 -SCRIPT_AFTER_MAKE_TEST=$7 +CMAKE_ARGS=$3 + +SCRIPT_BEFORE_CMAKE="../.github/ci-bionic/before_cmake.sh" +SCRIPT_BETWEEN_CMAKE_MAKE="../.github/ci-bionic/between_cmake_make.sh" +SCRIPT_AFTER_MAKE="../.github/ci-bionic/after_make.sh" +SCRIPT_AFTER_MAKE_TEST="../.github/ci-bionic/after_make_test.sh" cd $GITHUB_WORKSPACE @@ -54,7 +55,6 @@ fi mkdir build cd build -echo "SCRIPT_BEFORE_CMAKE" if [ ! -z "$SCRIPT_BEFORE_CMAKE" ] ; then . $SCRIPT_BEFORE_CMAKE fi @@ -65,14 +65,12 @@ else cmake .. $CMAKE_ARGS fi -echo "SCRIPT_BETWEEN_CMAKE_MAKE" if [ ! -z "$SCRIPT_BETWEEN_CMAKE_MAKE" ] ; then . $SCRIPT_BETWEEN_CMAKE_MAKE fi make -echo "SCRIPT_AFTER_MAKE" if [ ! -z "$SCRIPT_AFTER_MAKE" ] ; then . $SCRIPT_AFTER_MAKE fi @@ -80,7 +78,6 @@ fi export CTEST_OUTPUT_ON_FAILURE=1 make test -echo "SCRIPT_AFTER_MAKE_TEST" if [ ! -z "$SCRIPT_AFTER_MAKE_TEST" ] ; then . $SCRIPT_AFTER_MAKE_TEST fi