.github/workflows/ci.yml #22
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
env: | |
build_type: ${{ contains(github.event.head_commit.message, '[debug]') && 'Debug' || 'Release' }} | |
is_tagged: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
jobs: | |
Format: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check | |
uses: jidicula/[email protected] | |
with: | |
clang-format-version: '18' | |
check-path: '.' | |
Ubuntu: | |
runs-on: ubuntu-latest | |
needs: Format | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}/build/source | |
key: ${{ runner.os }}- | |
restore-keys: ${{ runner.os }}- | |
- uses: seanmiddleditch/gha-setup-ninja@master | |
- name: Configure | |
run: cmake -B ${{ github.workspace }}/build -G Ninja -DCMAKE_BUILD_TYPE=${{ env.build_type }} | |
- name: Build | |
run: cmake --build ${{ github.workspace }}/build | |
- name: Test | |
run: ctest -C ${{ env.build_type }} -VV --test-dir ${{ github.workspace }}/build | |
- name: Artifact | |
uses: actions/[email protected] | |
with: | |
name: Whisper-Linux | |
path: ${{ github.workspace }}/package/ | |
Windows: | |
runs-on: windows-latest | |
needs: Format | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}/build/source | |
key: ${{ runner.os }}- | |
restore-keys: ${{ runner.os }}- | |
- name: Configure | |
run: cmake -B ${{ github.workspace }}/build -G "Visual Studio 17 2022" -A x64 | |
- name: Build | |
run: cmake --build ${{ github.workspace }}/build --config ${{ env.build_type }} | |
- name: Test | |
run: ctest -C ${{ env.build_type }} -VV --test-dir ${{ github.workspace }}/build | |
- name: Artifact | |
uses: actions/[email protected] | |
with: | |
name: Whisper-Windows | |
path: ${{ github.workspace }}/package/Whisper-install.exe | |
MacOS: | |
runs-on: macos-latest | |
needs: Format | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}/build/source | |
key: ${{ runner.os }}- | |
restore-keys: ${{ runner.os }}- | |
- name: Prepare | |
run: | | |
security create-keychain -p ${{ secrets.DEV_ID_PASSWORD }} buildagent | |
security unlock-keychain -p ${{ secrets.DEV_ID_PASSWORD }} buildagent | |
security list-keychains -s buildagent && security default-keychain -s buildagent | |
echo ${{ secrets.DEV_ID_APP_CERT }} | base64 --decode > ./cert.p12 | |
security import ./cert.p12 -P ${{ secrets.DEV_ID_PASSWORD }} -A -t cert -f pkcs12 -k buildagent -T /usr/bin/codesign >/dev/null | |
rm ./cert.p12 | |
echo ${{ secrets.DEV_ID_INST_CERT }} | base64 --decode > ./cert.p12 | |
security import ./cert.p12 -P ${{ secrets.DEV_ID_PASSWORD }} -A -t cert -f pkcs12 -k buildagent -T /usr/bin/codesign >/dev/null | |
rm ./cert.p12 | |
security set-key-partition-list -S "apple-tool:,apple:,codesign:" -s -k ${{ secrets.DEV_ID_PASSWORD }} buildagent >/dev/null | |
xcrun notarytool store-credentials "notary-installer" --apple-id ${{ secrets.DEV_USER_APPLE_ID }} --team-id ${{ secrets.DEV_TEAM_APPLE_ID }} --password ${{ secrets.DEV_SPEC_APP_PASSWORD }} >/dev/null | |
- name: Configure | |
run: cmake -B ${{ github.workspace }}/build -G "Xcode" -DVPP_CODESIGN_APPLE_KEYCHAIN_PROFILE_INSTALLER="notary-installer" -DVPP_NOTARIZE=${{ env.is_tagged }} | |
- name: Build | |
run: set -o pipefail && cmake --build ${{ github.workspace }}/build --config ${{ env.build_type }} | xcbeautify --renderer github-actions | |
- name: Test | |
run: ctest -C ${{ env.build_type }} -VV --test-dir ${{ github.workspace }}/build | |
- name: Artifact | |
uses: actions/[email protected] | |
with: | |
name: Whisper-MacOS | |
path: ${{ github.workspace }}/package/Whisper.pkg |