linux friendly enrollment file (#112) #164
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: Go | |
on: | |
push: | |
branches: | |
- master | |
- main | |
workflow_dispatch: | |
env: | |
CARBON_VERSION: "1.32.1" | |
jobs: | |
linux: | |
name: Build (Linux) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-18.04, ubuntu-20.04] | |
go: [1.13, 1.17, 1.18] | |
steps: | |
- name: Set up Go ${{ matrix.go }} | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ matrix.go }} | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
- name: Get dependencies | |
run: | | |
go get -v -t -d ./... | |
if [ -f Gopkg.toml ]; then | |
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | |
dep ensure | |
fi | |
- name: Get Speech SDK (Linux) | |
run: | | |
mkdir $HOME/carbon | |
pushd $HOME/carbon | |
wget https://csspeechstorage.blob.core.windows.net/drop/$CARBON_VERSION/SpeechSDK-Linux-$CARBON_VERSION.tar.gz | |
tar xzf SpeechSDK-Linux-$CARBON_VERSION.tar.gz | |
rm SpeechSDK-Linux-$CARBON_VERSION.tar.gz | |
ln -s SpeechSDK-Linux-$CARBON_VERSION current | |
popd | |
- name: Get Carbon Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install libasound2 | |
sudo apt-get install -y libgstreamer1.0-0 gstreamer1.0-plugins-good | |
dpkg -l | grep gstreamer | |
- name: Build | |
run: | | |
export CGO_CFLAGS="-I$HOME/carbon/current/include/c_api" | |
export CGO_LDFLAGS="-L$HOME/carbon/current/lib/x64 -lMicrosoft.CognitiveServices.Speech.core" | |
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/carbon/current/lib/x64" | |
go build -v ./... | |
- name: Test | |
env: | |
DIALOG_SUBSCRIPTION_KEY: ${{ secrets.DIALOG_SUBSCRIPTION_KEY }} | |
DIALOG_SUBSCRIPTION_REGION: ${{ secrets.DIALOG_SUBSCRIPTION_REGION }} | |
SPEECH_SUBSCRIPTION_KEY: ${{ secrets.SR_SUBSCRIPTION_KEY }} | |
SPEECH_SUBSCRIPTION_REGION: ${{ secrets.SR_SUBSCRIPTION_REGION }} | |
SPEAKER_RECOGNITION_SUBSCRIPTION_KEY: ${{ secrets.SPEAKER_SUBSCRIPTION_KEY }} | |
SPEAKER_RECOGNITION_SUBSCRIPTION_REGION: ${{ secrets.SPEAKER_SUBSCRIPTION_REGION }} | |
run: | | |
export CGO_CFLAGS="-I$HOME/carbon/current/include/c_api" | |
export CGO_LDFLAGS="-L$HOME/carbon/current/lib/x64 -lMicrosoft.CognitiveServices.Speech.core" | |
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/carbon/current/lib/x64" | |
go test -v ./... | |
- name: 'Upload Test Logs' | |
uses: actions/upload-artifact@v2 | |
if: always() | |
with: | |
name: Log-${{ matrix.os }}-${{ matrix.go }} | |
path: '**/*.log' | |
retention-days: 3 | |
macos: | |
name: Build (macOS) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-10.15, macos-11.0] | |
steps: | |
- name: Install modern bash for macOS | |
run: | | |
export HOMEBREW_NO_INSTALL_CLEANUP=1 | |
brew config && brew install bash | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
- name: Get dependencies | |
run: | | |
go get -v -t -d ./... | |
if [ -f Gopkg.toml ]; then | |
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | |
dep ensure | |
fi | |
- name: Get Speech SDK (macOS) | |
run: | | |
cd ~ | |
wget https://csspeechstorage.blob.core.windows.net/drop/$CARBON_VERSION/MicrosoftCognitiveServicesSpeech-XCFramework-$CARBON_VERSION.zip -O SpeechSDK.zip | |
unzip SpeechSDK.zip -d speechsdk | |
- name: Build | |
run: | | |
export SDK_HOME="$HOME/speechsdk/MicrosoftCognitiveServicesSpeech.xcframework/macos-arm64_x86_64" | |
export CGO_CFLAGS="-I$SDK_HOME/MicrosoftCognitiveServicesSpeech.framework/Headers" | |
export CGO_LDFLAGS="-F$SDK_HOME -framework MicrosoftCognitiveServicesSpeech" | |
export DYLD_FRAMEWORK_PATH="$DYLD_FRAMEWORK_PATH:$SDK_HOME" | |
go build -v ./... | |
- name: Test | |
env: | |
DIALOG_SUBSCRIPTION_KEY: ${{ secrets.DIALOG_SUBSCRIPTION_KEY }} | |
DIALOG_SUBSCRIPTION_REGION: ${{ secrets.DIALOG_SUBSCRIPTION_REGION }} | |
SPEECH_SUBSCRIPTION_KEY: ${{ secrets.SR_SUBSCRIPTION_KEY }} | |
SPEECH_SUBSCRIPTION_REGION: ${{ secrets.SR_SUBSCRIPTION_REGION }} | |
SPEAKER_RECOGNITION_SUBSCRIPTION_KEY: ${{ secrets.SPEAKER_SUBSCRIPTION_KEY }} | |
SPEAKER_RECOGNITION_SUBSCRIPTION_REGION: ${{ secrets.SPEAKER_SUBSCRIPTION_REGION }} | |
run: | | |
export SDK_HOME="$HOME/speechsdk/MicrosoftCognitiveServicesSpeech.xcframework/macos-arm64_x86_64" | |
export CGO_CFLAGS="-I$SDK_HOME/MicrosoftCognitiveServicesSpeech.framework/Headers" | |
export CGO_LDFLAGS="-F$SDK_HOME -framework MicrosoftCognitiveServicesSpeech" | |
export DYLD_FRAMEWORK_PATH="$DYLD_FRAMEWORK_PATH:$SDK_HOME" | |
go test -v ./... |