Skip to content

Commit

Permalink
Add a job to build Bicep CLI for linux-musl-x64 (#1752)
Browse files Browse the repository at this point in the history
  • Loading branch information
shenglol authored Mar 10, 2021
1 parent 53ed432 commit f87fd5f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
build-bicep:
name: 'Build CLI'
name: 'Build CLI (${{ matrix.rid }})'
runs-on: ${{ matrix.os }}

env:
Expand All @@ -24,7 +24,6 @@ jobs:
fail-fast: false

matrix:
os: [ 'windows-latest', 'ubuntu-latest', 'macos-latest' ]
include:
- os: 'windows-latest'
rid: 'win-x64'
Expand All @@ -34,6 +33,10 @@ jobs:
rid: 'linux-x64'
configuration: 'release'
publishLanguageServer: 'true'
- os: 'ubuntu-latest'
rid: 'linux-musl-x64'
configuration: 'release'
publishLanguageServer: 'false'
- os: 'macos-latest'
rid: 'osx-x64'
configuration: 'release'
Expand Down Expand Up @@ -62,11 +65,21 @@ jobs:
run: dotnet publish --configuration ${{ matrix.configuration }} --self-contained true -p:PublishTrimmed=true -p:PublishSingleFile=true -r ${{ matrix.rid }} ./src/Bicep.Cli/Bicep.Cli.csproj

- name: Run Bicep E2E Tests
if: ${{ matrix.rid != 'linux-musl-x64' }}
run: npm ci && npm test
env:
BICEP_CLI_EXECUTABLE: ../Bicep.Cli/bin/${{ matrix.configuration }}/net5.0/${{ matrix.rid }}/publish/bicep
working-directory: ./src/Bicep.Cli.E2eTests

- name: Run Bicep E2E Tests (linux-musl-x64)
if: ${{ matrix.rid == 'linux-musl-x64' }}
uses: docker://microsoft/azure-cli:latest
with:
entrypoint: sh
args: -c "apk add --update nodejs npm && npm ci --prefix ./src/Bicep.Cli.E2eTests && npm test --prefix ./src/Bicep.Cli.E2eTests"
env:
BICEP_CLI_EXECUTABLE: ../Bicep.Cli/bin/${{ matrix.configuration }}/net5.0/${{ matrix.rid }}/publish/bicep

- name: Upload Language Server
uses: actions/upload-artifact@v2
if: ${{ matrix.publishLanguageServer == 'true' }}
Expand Down
18 changes: 18 additions & 0 deletions .pipelines/Common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,24 @@ stages:
official: ${{ parameters.official }}
rid: linux-x64

- job: bicep_linux_musl
pool:
type: linux # read more about custom job pool types at https://aka.ms/obpipelines/yaml/jobs

variables:
ob_outputDirectory: '$(Build.SourcesDirectory)/out' # this directory is uploaded to pipeline artifacts, reddog and cloudvault. More info at https://aka.ms/obpipelines/artifacts
# https://aka.ms/obpipelines/sdl
ob_sdl_binskim_enabled: true # you can disable sdl tools in non-official build
ob_sdl_binskim_break: false # always break the build on binskim issues. You can disable it by setting to 'false'
ob_sdl_binskim_scanOutputDirectoryOnly: true
ob_sdl_roslyn_break: true
# ob_sdl_suppression_suppressionFile: $(Build.SourcesDirectory)\.gdn\job.gdnsuppress
steps:
- template: Bicep.yml
parameters:
official: ${{ parameters.official }}
rid: linux-musl-x64

- job: bicep_osx
pool:
type: linux # read more about custom job pool types at https://aka.ms/obpipelines/yaml/jobs
Expand Down

0 comments on commit f87fd5f

Please sign in to comment.