| 1 |
# Run a build step in a container or directly on the Actions runner |
| 2 |
name: Run Build Step |
| 3 |
description: Run a build step in a container or directly on the Actions runner |
| 4 |
|
| 5 |
inputs: |
| 6 |
command: |
| 7 |
description: Command to run |
| 8 |
type: string |
| 9 |
required: true |
| 10 |
container: |
| 11 |
description: Optional container to run in |
| 12 |
type: string |
| 13 |
container-version: |
| 14 |
description: Version of the container to run |
| 15 |
type: string |
| 16 |
shell: |
| 17 |
description: Shell to use |
| 18 |
type: string |
| 19 |
required: true |
| 20 |
default: 'bash' |
| 21 |
|
| 22 |
runs: |
| 23 |
using: 'composite' |
| 24 |
steps: |
| 25 |
- run: | |
| 26 |
if [ -n "${{ inputs.container }}" ]; then |
| 27 |
docker run \ |
| 28 |
--rm \ |
| 29 |
--user "$(id -u):$(id -g)" \ |
| 30 |
-v "$(pwd)/source:/home/libgit2/source" \ |
| 31 |
-v "$(pwd)/build:/home/libgit2/build" \ |
| 32 |
-w /home/libgit2 \ |
| 33 |
-e ASAN_SYMBOLIZER_PATH \ |
| 34 |
-e CC \ |
| 35 |
-e CFLAGS \ |
| 36 |
-e CMAKE_GENERATOR \ |
| 37 |
-e CMAKE_OPTIONS \ |
| 38 |
-e GITTEST_NEGOTIATE_PASSWORD \ |
| 39 |
-e GITTEST_FLAKY_STAT \ |
| 40 |
-e PKG_CONFIG_PATH \ |
| 41 |
-e SKIP_NEGOTIATE_TESTS \ |
| 42 |
-e SKIP_SSH_TESTS \ |
| 43 |
-e SKIP_PUSHOPTIONS_TESTS \ |
| 44 |
-e TSAN_OPTIONS \ |
| 45 |
-e UBSAN_OPTIONS \ |
| 46 |
${{ inputs.container-version }} \ |
| 47 |
/bin/bash -c "${{ inputs.command }}" |
| 48 |
else |
| 49 |
${{ inputs.command }} |
| 50 |
fi |
| 51 |
shell: ${{ inputs.shell != '' && inputs.shell || 'bash' }} |