fleet/.github/workflows
Victor Lyuboslavsky 4eb72535dc
Support for MySQL 8.4.2 (#21364)
#21270

The main change for MySQL 8.4.2 is that foreign key constraints are
stricter:
https://dev.mysql.com/doc/refman/8.4/en/server-system-variables.html#sysvar_restrict_fk_on_non_standard_key

Also, most replica-related commands have been renamed.

# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files)
for more information.
- [x] Added/updated tests
- [x] If database migrations are included, checked table schema to
confirm autoupdate
- [x] Manual QA for all new/changed functionality
2024-08-16 16:32:38 +02:00
..
config Add summary to test-go.yml Slack message when it fails (#18188) 2024-04-10 18:04:26 -03:00
build-and-push-fleetctl-docker.yml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
build-binaries.yaml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
build-orbit.yaml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
check-automated-doc.yml Add github action to check the auto-generated documentation is up-to-date (#20025) 2024-06-27 06:35:09 -03:00
check-tuf-timestamps.yml increase TUF expiration warning by one day 2024-04-02 11:21:17 -03:00
code-sign-windows.yml Windows orbit.exe and fleet-desktop.exe are now signed. (#18201) 2024-04-26 12:46:23 -05:00
codeql-analysis.yml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
dependency-review.yml [StepSecurity] Apply security best practices (#17811) 2024-03-22 16:19:11 -05:00
deploy-fleet-website.yml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
deploy-vulnerability-dashboard.yml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
docs.yml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
dogfood-deploy.yml initial osquery docker sidecar and osquery local builds (#19641) 2024-06-12 13:25:07 -05:00
dogfood-gitops.yml Dogfood: best practice teams (#20359) 2024-07-15 16:22:15 -07:00
fleet-and-orbit.yml Use docker compose on CI instead of docker-compose (#21017) 2024-08-02 18:12:36 -03:00
fleetctl-preview-latest.yml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
fleetctl-preview.yml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
fleetd-tuf.yml Add reviewers to automated PRs (#18390) 2024-04-18 10:51:07 -03:00
generate-desktop-targets.yml Release fleetd 1.30.0 (#21071) 2024-08-06 07:32:24 -03:00
generate-nudge-targets.yml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
generate-osqueryd-targets.yml Release osqueryd 5.13.0 (#20949) 2024-08-02 14:57:50 -03:00
golangci-lint.yml bump golangci-lint to 1.55.2 (#18604) 2024-04-30 08:59:14 -06:00
goreleaser-fleet.yaml Update goreleaser runner (#21226) 2024-08-09 10:50:43 -07:00
goreleaser-orbit.yaml Release fleetd 1.28.0 (#20581) 2024-07-19 12:47:00 -03:00
goreleaser-snapshot-fleet.yaml Run workflow on push to branches beginning the minor- (#20549) 2024-07-17 12:31:12 -07:00
integration.yml Fixes to fleetctl debug connection and TLS certs documentation (#20166) 2024-07-09 14:04:23 -03:00
pr-helm.yaml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
push-osquery-perf-to-ecr.yml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
README.md add concurrency to ci (#8271) 2022-10-24 14:01:00 -06:00
release-fleetd-base.yml Releasing new fleetd-base flow (#20093) 2024-06-28 12:57:14 -05:00
release-fleetd-chrome-beta.yml Keep all fleetd-base and fleetd-chrome artifacts. (#19749) 2024-06-17 15:49:06 -05:00
release-fleetd-chrome.yml Keep all fleetd-base and fleetd-chrome artifacts. (#19749) 2024-06-17 15:49:06 -05:00
release-helm.yaml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
scorecards-analysis.yml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
test-db-changes.yml Host software deleted at remigration (#20996) 2024-08-02 10:47:40 -04:00
test-fleetd-chrome.yml Keep all fleetd-base and fleetd-chrome artifacts. (#19749) 2024-06-17 15:49:06 -05:00
test-go.yaml Support for MySQL 8.4.2 (#21364) 2024-08-16 16:32:38 +02:00
test-js.yml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
test-native-tooling-packaging.yml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
test-packaging.yml SSVPP Backend and CLI (#21132) 2024-08-14 10:25:32 -04:00
test-puppet.yml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
test-vulnerability-dashboard-changes.yml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
test-website.yml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
test-yml-specs.yml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
tfvalidate.yml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
trivy-scan.yml [StepSecurity] ci: Harden GitHub Actions (#17780) 2024-03-22 15:32:23 -05:00
update-certs.yml Add reviewers to automated PRs (#18390) 2024-04-18 10:51:07 -03:00
verify-fleetd-base.yml Validate base-fleetd daily (#20196) 2024-07-09 09:54:01 -05: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.