summaryrefslogtreecommitdiffstats
path: root/.github/actions/run-build/action.yml
blob: 9afcfb11e72e6aa87039105030d7b56670b86fe1 (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
46
47
48
49
50
51
# 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
    type: string
    required: true
  container:
    description: Optional container to run in
    type: string
  container-version:
    description: Version of the container to run
    type: string
  shell:
    description: Shell to use
    type: string
    required: true
    default: 'bash'

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 SKIP_PUSHOPTIONS_TESTS \
          -e TSAN_OPTIONS \
          -e UBSAN_OPTIONS \
          ${{ inputs.container-version }} \
          /bin/bash -c "${{ inputs.command }}"
      else
        ${{ inputs.command }}
      fi
    shell: ${{ inputs.shell != '' && inputs.shell || 'bash' }}