Skip to content

Commit

Permalink
Fix Mac and Linux builds (#385)
Browse files Browse the repository at this point in the history
* Trigger pipeline runs on changes to pipelines.

* Semmle in SDL run is replaced with LGTM on PRs

* Have LGTM check tests and benchmarks.
  • Loading branch information
gfs committed Apr 16, 2020
1 parent f0e7f22 commit ea03e82
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 54 deletions.
24 changes: 24 additions & 0 deletions .lgtm.yml
Expand Up @@ -5,3 +5,27 @@ extraction:
dotnet:
arguments: "-c release"
version: "3.1.201"

extraction:
csharp:
index:
solution: "Tests/Tests.csproj"
dotnet:
arguments: "-c release"
version: "3.1.201"

extraction:
csharp:
index:
solution: "Benchmarks/Benchmarks.csproj"
dotnet:
arguments: "-c release"
version: "3.1.201"

extraction:
csharp:
index:
solution: "Lib/Lib.csproj"
dotnet:
arguments: "-c release"
version: "3.1.201"
1 change: 1 addition & 0 deletions Pipelines/pr-validation.yml
Expand Up @@ -15,6 +15,7 @@ pr:
- Lib
- Tests
- Benchmarks
- Pipelines

variables:
solution: '**/*.sln'
Expand Down
33 changes: 9 additions & 24 deletions Pipelines/release.yml
@@ -1,11 +1,13 @@
name: ASA Release

pr: none
trigger:
batch: true
paths:
include:
- Cli
- Lib
- Pipelines
branches:
include:
- release/v2.*
Expand Down Expand Up @@ -214,18 +216,9 @@ stages:
script: |
VERSION="$(nbgv get-version -v AssemblyInformationalVersion | cut -d'+' -f 1)"
mkdir $BIN_DIR/Asa-linux-$VERSION
mv $BIN_DIR/linux/Asa $BIN_DIR/Asa-linux-$VERSION/res/
cp $SRC_DIR/Asa/AsaLaunch.sh $BIN_DIR/Asa-linux-$VERSION/AsaLaunch.sh
cp $SRC_DIR/Asa/AsaLaunchGui.sh $BIN_DIR/Asa-linux-$VERSION/AsaLaunchGui.sh
chmod +x $BIN_DIR/Asa-linux-$VERSION/AsaLaunch.sh
chmod +x $BIN_DIR/Asa-linux-$VERSION/AsaLaunchGui.sh
chmod +x $BIN_DIR/Asa-linux-$VERSION/res/Asa
cd $BIN_DIR
tar -czvf $ART_DIR/Asa-linux-$VERSION.tar.gz Asa-linux-$VERSION
mv $BIN_DIR/linux $BIN_DIR/Asa-linux-$VERSION
tar -czvf $ART_DIR/Asa-linux-$VERSION.tar.gz $BIN_DIR/Asa-linux-$VERSION
sha256sum $ART_DIR/Asa-linux-$VERSION.tar.gz | awk ' { n=split($2, a, "/"); $2 = a[n]; print; } ' OFS='\t' >> $BIN_DIR/HASHES_LINUX.txt
displayName: 'Prepare Artifacts'
Expand Down Expand Up @@ -277,23 +270,15 @@ stages:
projects: 'Cli/Cli.csproj'
arguments: '--configuration $(BuildConfiguration) --output $(build.binariesdirectory)/macos -r osx-x64'
zipAfterPublish: false

- task: CmdLine@2
inputs:
script: |
VERSION="$(nbgv get-version -v AssemblyInformationalVersion | cut -d'+' -f 1)"
mkdir $BIN_DIR/Asa-macos-$VERSION
mv $BIN_DIR/macos/Asa $BIN_DIR/Asa-macos-$VERSION/res/
cp $SRC_DIR/Asa/AsaLaunch.sh $BIN_DIR/Asa-macos-$VERSION/AsaLaunch.sh
cp $SRC_DIR/Asa/AsaLaunchGui.sh $BIN_DIR/Asa-macos-$VERSION/AsaLaunchGui.sh
chmod +x $BIN_DIR/Asa-macos-$VERSION/AsaLaunch.sh
chmod +x $BIN_DIR/Asa-macos-$VERSION/AsaLaunchGui.sh
chmod +x $BIN_DIR/Asa-macos-$VERSION/res/Asa
cd $BIN_DIR
tar -czvf $ART_DIR/Asa-macos-$VERSION.tar.gz Asa-macos-$VERSION
mv $BIN_DIR/macos $BIN_DIR/Asa-macos-$VERSION
tar -czvf $ART_DIR/Asa-macos-$VERSION.tar.gz $BIN_DIR/Asa-macos-$VERSION
sha256sum $ART_DIR/Asa-macos-$VERSION.tar.gz | awk ' { n=split($2, a, "/"); $2 = a[n]; print; } ' OFS='\t' >> $BIN_DIR/HASHES_MAC.txt
displayName: 'Prepare Artifacts'
Expand Down
31 changes: 1 addition & 30 deletions Pipelines/sdl.yml
Expand Up @@ -10,8 +10,6 @@ schedules:
include:
- master
- releases/*
exclude:
- releases/2.0

pool:
vmImage: 'windows-latest'
Expand All @@ -35,27 +33,6 @@ steps:
inputs:
toolMajorVersion: 'V2'
outputFormat: 'sarif'
- task: Semmle@0
displayName: Semmle C#
inputs:
sourceCodeDirectory: '$(Build.SourcesDirectory)'
language: 'csharp'
cleanupBuildCommands: 'dotnet clean'
buildCommands: 'dotnet build'
querySuite: 'Recommended'
timeout: '1800'
ram: '16384'
addProjectDirToScanningExclusionList: true
- task: Semmle@0
displayName: Semmle JS
inputs:
sourceCodeDirectory: '$(Build.SourcesDirectory)\Cli\wwwroot'
language: 'javascript'
includeNodeModules: false
querySuite: 'Recommended'
timeout: '1800'
ram: '16384'
addProjectDirToScanningExclusionList: true

- task: SdtReport@1
inputs:
Expand All @@ -73,7 +50,7 @@ steps:
PoliCheck: false
RoslynAnalyzers: false
SDLNativeRules: false
Semmle: true
Semmle: false
SemmleBreakOn: 'Error'
TSLint: false
ToolLogsNotFoundAction: 'Standard'
Expand Down Expand Up @@ -102,12 +79,6 @@ steps:
targetPath: '$(Pipeline.Workspace)\_sdt\logs\CredentialScanner\CredentialScanner-matches.sarif'
artifact: 'CredScan.sarif'

- task: PublishPipelineArtifact@1
displayName: Publish C# Semmle Result
inputs:
targetPath: '$(Pipeline.Workspace)\_sdt\logs\Semmle\csharp\microsoft.AttackSurfaceAnalyzer-csharp-1.sarif'
artifact: 'SemmleCS.sarif'

- task: PublishPipelineArtifact@1
displayName: Publish JS Semmle Result
inputs:
Expand Down

0 comments on commit ea03e82

Please sign in to comment.