summaryrefslogtreecommitdiff
path: root/meshmc/.github/actions/setup-dependencies/action.yml
blob: 32458267683bc25a71ce04a1899299f752b25250 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Setup Dependencies
description: Install and setup dependencies for building MeshMC

inputs:
  build-type:
    description: Type for the build
    required: true
    default: Debug
  artifact-name:
    description: Name of the uploaded artifact
    required: true
  msystem:
    description: MSYS2 subsystem to use
    required: false
  vcvars-arch:
    description: Visual Studio architecture to use
    required: false
  qt-architecture:
    description: Qt architecture
    required: false
  qt-version:
    description: Version of Qt to use
    required: true
  github-token:
    description: GitHub token for package feed authentication
    required: false
    default: ${{ github.token }}

outputs:
  build-type:
    description: Type of build used
    value: ${{ inputs.build-type }}
  qt-version:
    description: Version of Qt used
    value: ${{ inputs.qt-version }}

runs:
  using: composite

  steps:
    - name: Setup Linux dependencies
      if: ${{ runner.os == 'Linux' }}
      uses: ./.github/actions/setup-dependencies/linux
      with:
        github-token: ${{ inputs.github-token }}

    - name: Setup macOS dependencies
      if: ${{ runner.os == 'macOS' }}
      uses: ./.github/actions/setup-dependencies/macos
      with:
        build-type: ${{ inputs.build-type }}
        github-token: ${{ inputs.github-token }}

    - name: Setup Windows dependencies
      if: ${{ runner.os == 'Windows' }}
      uses: ./.github/actions/setup-dependencies/windows
      with:
        build-type: ${{ inputs.build-type }}
        msystem: ${{ inputs.msystem }}
        vcvars-arch: ${{ inputs.vcvars-arch }}
        github-token: ${{ inputs.github-token }}

    # TODO(@YongDo-Hyun): Get this working on MSYS2!
    - name: Setup ccache
      if: ${{ (runner.os != 'Windows' || inputs.msystem == '') && inputs.build-type == 'Debug' }}
      uses: hendrikmuhs/ccache-action@v1.2.22
      with:
        variant: sccache
        create-symlink: ${{ runner.os != 'Windows' }}
        key: ${{ runner.os }}-${{ runner.arch }}-${{ inputs.artifact-name }}-sccache

    - name: Use ccache on debug builds
      if: ${{ inputs.build-type == 'Debug' }}
      shell: bash
      env:
        # Only use ccache on MSYS2
        CCACHE_VARIANT: ${{ (runner.os == 'Windows' && inputs.msystem != '') && 'ccache' || 'sccache' }}
      run: |
        echo "CMAKE_C_COMPILER_LAUNCHER=$CCACHE_VARIANT" >> "$GITHUB_ENV"
        echo "CMAKE_CXX_COMPILER_LAUNCHER=$CCACHE_VARIANT" >> "$GITHUB_ENV"

    - name: Install Qt
      if: ${{ inputs.msystem == '' }}
      uses: jurplel/install-qt-action@v4
      with:
        aqtversion: "==3.1.*"
        version: ${{ inputs.qt-version }}
        modules: qtimageformats qtnetworkauth qt5compat
        cache: ${{ inputs.build-type == 'Debug' }}