Skip to content

Commit

Permalink
add -build-codeql flag for codeql.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kjk committed Aug 6, 2024
1 parent 7765a4c commit c47d31b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 29 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ jobs:
name: Build
#runs-on: SumatraBuilder
runs-on: windows-latest
#runs-on: windows-2019
steps:
# - name: Set up Go
# uses: actions/setup-go@v4
# with:
# go-version: "1.21"

- name: Check out source code
uses: actions/checkout@v4
with:
Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
name: "CodeQL"

on:
schedule:
push:
branches: [ "master" ]
schedule:
- cron: '45 10 * * 1'

jobs:
Expand Down Expand Up @@ -41,7 +43,7 @@ jobs:
matrix:
include:
- language: c-cpp
build-mode: autobuild
build-mode: manual
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
Expand Down Expand Up @@ -73,15 +75,8 @@ jobs:
# to build your code.
# ️ Command-line programs to run using the OS shell.
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- if: matrix.build-mode == 'manual'
run: .\doit.bat -build-codeql

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ jobs:
name: Build
#runs-on: SumatraBuilder
runs-on: windows-latest
#runs-on: windows-2019
steps:
# - name: Set up Go
# uses: actions/setup-go@v4
# with:
# go-version: "1.21"

- name: Check out source code
uses: actions/checkout@v4
with:
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/daily_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@ jobs:
name: Build
#runs-on: SumatraBuilder
runs-on: windows-latest
#runs-on: windows-2019
steps:
# - name: Set up Go
# uses: actions/setup-go@v4
# with:
# go-version: "1.21"

- name: Check out source code
uses: actions/checkout@v4
with:
Expand Down
8 changes: 8 additions & 0 deletions do/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,14 @@ func buildRelease() {
copyBuiltManifest(dstDir, prefix)
}

// build for codeql: just static 64-bit release build
func buildCodeQL() {
//cleanPreserveSettings()
msbuildPath := detectMsbuildPath()
runExeLoggedMust(msbuildPath, `vs2022\SumatraPDF.sln`, `/t:SumatraPDF:Rebuild`, `/p:Configuration=Release;Platform=x64`, `/m`)
revertBuildConfig()
}

// smoke build is meant to be run locally to check that we can build everything
// it does full installer build of 64-bit release build
// We don't build other variants for speed. It takes about 5 mins locally
Expand Down
7 changes: 7 additions & 0 deletions do/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ func main() {
flgBuildPreRelease bool
flgBuildRelease bool
flgBuildSmoke bool
flgBuildCodeQL bool
flgCheckAccessKeys bool
flgCIBuild bool
flgCIDailyBuild bool
Expand Down Expand Up @@ -269,6 +270,7 @@ func main() {
flag.BoolVar(&flgBuildSmoke, "build-smoke", false, "run smoke build (installer for 64bit release)")
flag.BoolVar(&flgBuildPreRelease, "build-pre-rel", false, "build pre-release")
flag.BoolVar(&flgBuildRelease, "build-release", false, "build release")
flag.BoolVar(&flgBuildCodeQL, "build-codeql", false, "build for codeql")
//flag.BoolVar(&flgBuildLzsa, "build-lzsa", false, "build MakeLZSA.exe")
flag.BoolVar(&flgUpload, "upload", false, "upload the build to s3 and do spaces")
flag.BoolVar(&flgClangFormat, "format", false, "format source files with clang-format")
Expand Down Expand Up @@ -470,6 +472,11 @@ func main() {
return
}

if flgBuildCodeQL {
buildCodeQL()
return
}

if flgBuildSmoke {
buildSmoke()
return
Expand Down

0 comments on commit c47d31b

Please sign in to comment.