summaryrefslogtreecommitdiff
path: root/.github/actions/run-build/action.yml
blob: 41145d3b4f082770d9544a060eaf29cf88a49e2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Run a build step in a container or directly on the Actions runner
name: Run Build Step
description: Run a build step in a container or directly on the Actions runner

inputs:
  command:
    description: Command to run
    required: true
    type: string
  container:
    description: Optional container to run in
    type: string
  container-version:
    description: Version of the container to run
    type: string

runs:
  using: 'composite'
  steps:
  - run: |
      if [ -n "${{ inputs.container }}" ]; then
        docker run \
          --rm \
          --user "$(id -u):$(id -g)" \
          -v "$(pwd)/source:/home/libgit2/source" \
          -v "$(pwd)/build:/home/libgit2/build" \
          -w /home/libgit2 \
          -e ASAN_SYMBOLIZER_PATH \
          -e CC \
          -e CFLAGS \
          -e CMAKE_GENERATOR \
          -e CMAKE_OPTIONS \
          -e GITTEST_NEGOTIATE_PASSWORD \
          -e GITTEST_FLAKY_STAT \
          -e PKG_CONFIG_PATH \
          -e SKIP_NEGOTIATE_TESTS \
          -e SKIP_SSH_TESTS \
          -e TSAN_OPTIONS \
          -e UBSAN_OPTIONS \
          ${{ inputs.container-version }} \
          /bin/bash -c "${{ inputs.command }}"
      else
        ${{ inputs.command }}
      fi
    shell: bash