1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-02 00:29:41 +02:00
audacity/.github/workflows/cmake_build.yml
Edgar 8a0502febd
CI: Install Conan using package manager
Before this change, the CI used `pip` to install Conan. This was not optimal.

Signed-off-by: Edgar <Edgar@AnotherFoxGuy.com>
2021-07-26 22:04:36 +00:00

167 lines
5.3 KiB
YAML

name: CMake Build
on:
push:
branches:
- master
pull_request:
defaults:
run:
shell: bash
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
env:
AUDACITY_CMAKE_GENERATOR: ${{ matrix.config.generator }}
AUDACITY_ARCH_LABEL: ${{ matrix.config.arch }}
# Windows codesigning
# This variables will be used by all the steps
WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
# Conan home location to be used for cache action
CONAN_USER_HOME: "${{ github.workspace }}/conan-home/"
CONAN_USER_HOME_SHORT: "${{ github.workspace }}/conan-home/short"
strategy:
fail-fast: false
matrix:
config:
- name: Ubuntu_18.04
os: ubuntu-18.04
arch: x86_64 # as reported by `arch` or `uname -m`
generator: Unix Makefiles
compiler_cache: ccache
compiler_cache_path: ~/.ccache
- name: macOS_Intel
os: macos-latest
arch: Intel # as reported by Apple menu > About This Mac
generator: Unix Makefiles
# LAME only builds in Conan when not using the Xcode generator if explicitly setting GCC
cc: gcc
cxx: g++
compiler_cache: ccache
compiler_cache_path: ~/Library/Caches/ccache
- name: Windows_32bit
os: windows-latest
arch: x86
# required so CMake uses MSVC rather than MinGW
cc: cl
cxx: cl
generator: Ninja
compiler_cache: sccache
compiler_cache_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache
- name: Windows_64bit
os: windows-latest
arch: amd64
# required so CMake uses MSVC rather than MinGW
cc: cl
cxx: cl
generator: Ninja
compiler_cache: sccache
compiler_cache_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Add conan to path
if: runner.os == 'Windows'
run: echo "C:\Program Files\Conan\conan\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
shell: pwsh
- name: Dependencies
run: |
exec bash "scripts/ci/dependencies.sh"
- name: Environment
run: |
source "scripts/ci/environment.sh"
- name: Install Apple codesigning certificates
uses: apple-actions/import-codesign-certs@v1
if: startswith( matrix.config.os, 'macos' ) && github.event_name == 'push' && github.repository_owner == 'audacity'
with:
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }}
p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
# required for CMake to find Ninja
- name: "[Windows] Set up MSVC Developer Command Prompt"
if: runner.os == 'Windows'
uses: seanmiddleditch/gha-setup-vsdevenv@v3
with:
arch: ${{ matrix.config.arch }}
# Having this in PATH breaks building LAME in Conan when not using Visual Studio CMake generator
- name: "[Windows] Remove MinGW link"
if: runner.os == 'Windows'
run: rm "C:/Program Files/Git/usr/bin/link.EXE"
- name: "Set up compiler cache"
uses: actions/cache@v2
with:
path: ${{ matrix.config.compiler_cache_path }}
key: ${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ github.head_ref }}-${{ github.run_number }}
restore-keys: |
${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ github.head_ref }}-
${{ matrix.config.os }}-${{ matrix.config.arch }}-
- name: Cache for .conan
id: cache-conan
uses: actions/cache@v2
env:
cache-name: cache-conan-modules
with:
path: ${{ env.CONAN_USER_HOME }}
key: host-${{ matrix.config.name }}-${{ hashFiles('cmake-proxies/CMakeLists.txt') }}
restore-keys: |
host-${{ matrix.config.name }}-
# Install scdoc with conan TODO: Move conan pkg to own repo
- name: "[Linux] Install scdoc"
if: runner.os == 'Linux'
run: |
conan remote add -f rigs-of-rods-deps https://conan.cloudsmith.io/rigs-of-rods/deps/
conan install scdoc/1.11.1@anotherfoxguy/stable -g=virtualenv --build=missing
- name: Configure
env:
# Apple code signing
APPLE_CODESIGN_IDENTITY: ${{ secrets.APPLE_CODESIGN_IDENTITY }}
APPLE_NOTARIZATION_USER_NAME: ${{ secrets.APPLE_NOTARIZATION_USER_NAME }}
APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
run: |
exec bash "scripts/ci/configure.sh"
- name: Build
run: |
exec bash "scripts/ci/build.sh"
- name: "Print compiler cache stats"
run: ${{ matrix.config.compiler_cache }} -s
- name: Install
run: |
exec bash "scripts/ci/install.sh"
- name: Package
run: |
exec bash "scripts/ci/package.sh"
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: Tenacity_${{ matrix.config.name }}_${{ github.run_id }}_${{ env.GIT_HASH_SHORT }}
path: |
build/package/*
!build/package/_CPack_Packages
if-no-files-found: error