bump timeout on mdfind from 30 to 60 seconds (#1271) #2939
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: | |
workflow_dispatch: | |
push: | |
branches: [main, master] | |
tags: '*' | |
pull_request: | |
branches: '**' | |
jobs: | |
build_and_test: | |
name: launcher | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false # Consider changing this sometime | |
matrix: | |
os: | |
- ubuntu-20.04 | |
- macos-12 | |
- windows-latest | |
steps: | |
- name: Check out code | |
id: checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # need a full checkout for `git describe` | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: './go.mod' | |
check-latest: true | |
id: go | |
# use bash, because the powershell syntax is different and this is a cross platform workflow | |
- id: go-cache-paths | |
shell: bash | |
run: | | |
echo "go-build=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" | |
echo "go-mod=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" | |
- name: Go Build Cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.go-cache-paths.outputs.go-build }} | |
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} | |
- name: Go Mod Cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.go-cache-paths.outputs.go-mod }} | |
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} | |
- name: Get dependencies | |
run: make deps | |
- name: Run govulncheck | |
run: go install golang.org/x/vuln/cmd/govulncheck@latest; govulncheck ./... | |
- name: Set up zig | |
if: ${{ contains(matrix.os, 'ubuntu') }} | |
uses: goto-bus-stop/setup-zig@v2 | |
- name: Build | |
run: make -j2 github-build | |
- name: Lipo | |
run: make github-lipo | |
if: ${{ contains(matrix.os, 'macos') }} | |
- name: App Bundle | |
run: make github-launcherapp | |
if: ${{ contains(matrix.os, 'macos') }} | |
- name: Test | |
run: make test | |
# Launcher should always successfully run and exit cleanly when called with `version` -- this is a quick | |
# check to ensure that launcher can update to this build. | |
- name: Test build - macOS and ubuntu | |
if: ${{ contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu') }} | |
run: | | |
if ! ./build/launcher --version; then | |
echo "launcher.exe --version failed" | |
exit 1 | |
fi | |
# Launcher should always successfully run and exit cleanly when called with `version` -- this is a quick | |
# check to ensure that launcher can update to this build. | |
- name: Test build - Windows | |
if: ${{ contains(matrix.os, 'windows') }} | |
shell: powershell | |
run: | | |
.\build\launcher.exe --version | |
if( !$? ) { | |
throw "launcher.exe --version failed" | |
} | |
- name: Upload Build - Windows | |
if: ${{ contains(matrix.os, 'windows') }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ matrix.os }}-build | |
path: build/ | |
- name: Upload Build - macOS | |
if: ${{ contains(matrix.os, 'macos') }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: macos-latest-build | |
path: build/ | |
- name: Upload Build - Ubuntu | |
if: ${{ contains(matrix.os, 'ubuntu') }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ubuntu-latest-build | |
path: build/ | |
- name: Upload coverage | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ matrix.os }}-coverage.out | |
path: coverage.out | |
package_builder_test: | |
name: package_builder | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: | |
- ubuntu-20.04 | |
- macos-12 | |
- windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # need a full checkout for `git describe` | |
- uses: actions/setup-go@v3 | |
with: | |
go-version-file: './go.mod' | |
check-latest: true | |
id: go | |
- id: go-cache-paths | |
shell: bash | |
run: | | |
echo "go-build=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" | |
echo "go-mod=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" | |
- name: Go Build Cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.go-cache-paths.outputs.go-build }} | |
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} | |
- name: Go Mod Cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.go-cache-paths.outputs.go-mod }} | |
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} | |
- run: make deps | |
- id: build | |
run: make package-builder | |
- name: package | |
id: run-package-builder | |
run: ${{ steps.build.outputs.binary }} make -debug --hostname=localhost --enroll_secret=secret --launcher_version=nightly --output_dir=./ | |
- name: Test install macOS | |
if: ${{ contains(matrix.os, 'macos') }} | |
run: | | |
# Check that we can install | |
sudo installer -dumplog -pkg ./launcher.darwin-launchd-pkg.pkg -target / | |
# Quick check that at least a couple of the files we expect now exist | |
if [ ! -f /Library/LaunchDaemons/com.launcher.launcher.plist ]; then echo "missing launchd entry" && exit 1; fi | |
if [ ! -f /usr/local/launcher/bin/osqueryd ]; then echo "missing osquery binary" && exit 1; fi | |
if [ ! -f /usr/local/launcher/Kolide.app/Contents/MacOS/launcher ]; then echo "missing launcher binary" && exit 1; fi | |
if [ ! -L /usr/local/launcher/bin/launcher ]; then echo "missing launcher symlink" && exit 1; fi | |
if [ ! -e /usr/local/launcher/bin/launcher ]; then echo "launcher symlink is present but broken" && exit 1; fi | |
# This job is here as a github status check -- it allows us to move | |
# the merge dependency from being on all the jobs to this single | |
# one. | |
ci_mergeable: | |
runs-on: ubuntu-latest | |
steps: | |
- run: true | |
needs: | |
- build_and_test | |
- package_builder_test |