Skip to content

Commit

Permalink
hardcode script paths
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina committed Jul 20, 2020
1 parent d8cb883 commit ccd567d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 34 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
20 changes: 0 additions & 20 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
15 changes: 6 additions & 9 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -54,7 +55,6 @@ fi
mkdir build
cd build

echo "SCRIPT_BEFORE_CMAKE"
if [ ! -z "$SCRIPT_BEFORE_CMAKE" ] ; then
. $SCRIPT_BEFORE_CMAKE
fi
Expand All @@ -65,22 +65,19 @@ 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

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
Expand Down

0 comments on commit ccd567d

Please sign in to comment.