fleet/.github/workflows
Zachary Winnerman 3158da0985
Terraform version bump (#10513)
# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [ ] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [ ] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)
- [ ] Documented any permissions changes
- [ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.
- [ ] Added/updated tests
- [ ] Manual QA for all new/changed functionality
  - For Orbit and Fleet Desktop changes:
- [ ] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- [ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).
2023-03-15 12:41:25 -04:00
..
config set default shell in workflows (#8108) 2022-10-07 09:43:56 -06:00
build-and-push-fleetctl-docker.yml Pin actions to commit SHA (#10204) 2023-02-28 17:55:38 -08:00
build-binaries.yaml Bump actions/cache from 3.0.8 to 3.2.6 (#10268) 2023-03-02 13:51:13 -08:00
build-orbit.yaml Remove contents:write from build-orbit action (#10156) 2023-02-27 19:51:43 -08:00
codeql-analysis.yml Bump github/codeql-action from 2.1.21 to 2.2.5 (#10220) 2023-03-01 11:39:55 -08:00
deploy-fleet-website.yml Pin actions to commit SHA (#10204) 2023-02-28 17:55:38 -08:00
docs.yml add concurrency to ci (#8271) 2022-10-24 14:01:00 -06:00
dogfood-deploy.yml Terraform version bump (#10513) 2023-03-15 12:41:25 -04:00
fleet-and-orbit.yml Windows installer now ensures that legacy osquery installations gets removed during clean install (#9048) 2022-12-19 16:06:44 -08:00
fleetctl-preview-latest.yml Update go to 1.19.4 (#8945) 2022-12-09 11:47:17 -03:00
fleetctl-preview.yml Notify Go and Integration CI failures to new channel (#10235) 2023-03-01 20:14:07 -03:00
fleetctl-profiles.yml Add MDM profiles and github workflow to apply them (#10416) 2023-03-10 11:23:10 -06:00
generate-desktop-targets.yml Update go to 1.19.4 (#8945) 2022-12-09 11:47:17 -03:00
generate-nudge-targets.yml Generate Nudge targets in CI (#9845) 2023-02-20 09:23:56 -08:00
generate-osqueryd-targets.yml Generate targets for osqueryd 5.8.1 (#10245) 2023-03-01 17:51:15 -08:00
golangci-lint.yml Fix golangci-lint issue and run Github action on all OSs (#9944) 2023-02-21 14:30:45 -03:00
goreleaser-fleet.yaml Pin actions to commit SHA (#10204) 2023-02-28 17:55:38 -08:00
goreleaser-orbit.yaml Update Orbit to use CGO on Linux (#9846) 2023-02-21 18:49:13 -08:00
goreleaser-snapshot-fleet.yaml Pin actions to commit SHA (#10204) 2023-02-28 17:55:38 -08:00
integration.yml Notify Go and Integration CI failures to new channel (#10235) 2023-03-01 20:14:07 -03:00
pr-helm.yaml add concurrency to ci (#8271) 2022-10-24 14:01:00 -06:00
push-osquery-perf-to-ecr.yml Bump aws-actions/amazon-ecr-login from 1.5.0 to 1.5.3 (#8507) 2023-02-27 18:15:16 -08:00
README.md add concurrency to ci (#8271) 2022-10-24 14:01:00 -06:00
release-helm.yaml Bump stefanprodan/helm-gh-pages from 1.5.0 to 1.7.0 (#8804) 2023-02-27 18:17:32 -08:00
scorecards-analysis.yml Update OSSF Scorecards action (#10255) 2023-03-02 09:14:42 -08:00
test-db-changes.yml Run make dump-test-schema (#10505) 2023-03-15 10:47:49 -03:00
test-go.yaml Observers can observe team settings (#10447) 2023-03-13 15:34:39 -03:00
test-native-tooling-packaging.yml Update go to 1.19.4 (#8945) 2022-12-09 11:47:17 -03:00
test-packaging.yml Update go to 1.19.4 (#8945) 2022-12-09 11:47:17 -03:00
test-website.yml Website: fix failing GitHub workflows (#9285) 2023-01-11 13:31:20 -06:00
test.yml Bump actions/cache from 3.0.8 to 3.2.6 (#10268) 2023-03-02 13:51:13 -08:00
tfsec.yml Bump github/codeql-action from 2.1.21 to 2.2.5 (#10220) 2023-03-01 11:39:55 -08:00
tfvalidate.yml Pin actions to commit SHA (#10204) 2023-02-28 17:55:38 -08:00
trivy_scan.yml Pin actions to commit SHA (#10204) 2023-02-28 17:55:38 -08:00
update-certs.yml add concurrency to ci (#8271) 2022-10-24 14:01:00 -06:00

Github Actions

Fleet uses Github Actions for continuous integration (CI). This document describes best practices and at patterns for writing and maintaining Fleet's Github Actions workflows.

Bash

By default, Github Actions sets the shell to bash -e for linux and MacOS runners. To help write safer bash scripts in run jobs and avoid common issues, override the default by adding the following to the workflow file

defaults:
  run:
    # fail-fast using bash -eo pipefail. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
    shell: bash

By specifying the default shell to bash, some extra flags are set. The option pipefail changes the behaviour when using the pipe | operator such that if any command in a pipeline fails, that commands return code will be used a the return code for the whole pipeline. Consider the following example in test-go.yaml

    - name: Run Go Tests
      run: |
        # omitted ...
          make test-go 2>&1 | tee /tmp/gotest.log

If the pipefail option was not set, this job would always succeed because tee would always return success. This is not the intended behavior. Instead, we want the job to fail if make test-go fails.

Concurrency

Github Action runners are limited. If a lot of workflows are queued, they will wait in pending until a runner becomes available. This has caused issue in the past where workflows take an excessively long time to start. To help with this issue, use the following in workflows

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id}}
  cancel-in-progress: true

When a workflow is triggered via a pull request, it will cancel previous running workflows for that pull request. This is especially useful when changes are pushed to a pull request frequently. Manually triggered workflows, workflows that run on a schedule, and workflows triggered by pushes to main are unaffected.