Skip to content

Commit

Permalink
Add workflows that build tools on Mac OS and Windows (#19226)
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Tkachenko <[email protected]>
Co-authored-by: Victor Sokolov <[email protected]>
  • Loading branch information
r0mant and gzigzigzeo authored Dec 20, 2022
1 parent b4e1d5d commit 91f7030
Show file tree
Hide file tree
Showing 13 changed files with 269 additions and 10 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build-macos-bypass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow is required to ensure that required Github check passes even if
# the actual "Build on Mac OS" workflow skipped due to path filtering. Otherwise
# it will stay forever pending.
#
# See "Handling skipped but required checks" for more info:
#
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
#
# Note both workflows must have the same name.

name: Build on Mac OS
run-name: Skip Build on Mac OS

on:
pull_request:
paths-ignore:
- '**.go'
- 'go.mod'
- 'go.sum'
- '**.rs'
- 'Cargo.toml'
- 'Cargo.lock'

jobs:
build:
name: Skipped
runs-on: macos-12

permissions:
contents: none

steps:
- run: 'echo "No code changes"'
40 changes: 40 additions & 0 deletions .github/workflows/build-macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build on Mac OS
run-name: Build on Mac OS

on:
push:
branches:
- master
pull_request:
paths:
- '**.go'
- 'go.mod'
- 'go.sum'
- '**.rs'
- 'Cargo.toml'
- 'Cargo.lock'

jobs:
build:
name: Build all tools on Mac OS
runs-on: macos-12 # TODO(r0mant): Update with large runner when it's available

permissions:
contents: read

steps:
- name: Checkout Teleport
uses: actions/checkout@v3

- name: Get Go version
id: go-version
shell: bash
run: echo "go-version=$(make --no-print-directory print-go-version | tr -d '\n')" >> $GITHUB_OUTPUT

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ steps.go-version.outputs.go-version }}

- name: Build
run: make binaries
32 changes: 32 additions & 0 deletions .github/workflows/build-windows-bypass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow is required to ensure that required Github check passes even if
# the actual "Build on Windows" workflow skipped due to path filtering. Otherwise
# it will stay forever pending.
#
# See "Handling skipped but required checks" for more info:
#
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
#
# Note both workflows must have the same name.

name: Build on Windows
run-name: Skip Build on Windows

on:
pull_request:
# We only build tsh on Windows so only consider Go code as tsh doesn't
# run any Rust.
paths-ignore:
- '**.go'
- 'go.mod'
- 'go.sum'

jobs:
build:
name: Skipped
runs-on: windows-latest

permissions:
contents: none

steps:
- run: 'echo "No code changes"'
41 changes: 41 additions & 0 deletions .github/workflows/build-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build on Windows
run-name: Build on Windows

on:
push:
branches:
- master
pull_request:
# We only build tsh on Windows so only consider Go code as tsh doesn't
# run any Rust.
paths:
- '**.go'
- 'go.mod'
- 'go.sum'

jobs:
build:
name: Build tsh tool on Windows
runs-on: windows-2022-16core

permissions:
contents: read

steps:
- name: Checkout Teleport
uses: actions/checkout@v3

- name: Get Go version
id: go-version
shell: bash
run: echo "go-version=$(make --no-print-directory print-go-version | tr -d '\n')" >> $GITHUB_OUTPUT

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ steps.go-version.outputs.go-version }}

- name: Build
run: |
$Env:OS="windows"
make build/tsh
30 changes: 30 additions & 0 deletions .github/workflows/integration-tests-non-root-bypass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow is required to ensure that required Github check passes even if
# the actual "Integration Tests (Non-root)" workflow skipped due to path filtering.
# Otherwise it will stay forever pending.
#
# See "Handling skipped but required checks" for more info:
#
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
#
# Note both workflows must have the same name.

name: Integration Tests (Non-root)
run-name: Skip Integration Tests (Non-root) - ${{ github.run_id }} - @${{ github.actor }}

on:
pull_request:
paths-ignore:
- '**.go'
- 'go.mod'
- 'go.sum'

jobs:
test:
name: Skipped
runs-on: ubuntu-latest

permissions:
contents: none

steps:
- run: 'echo "No changes to verify"'
30 changes: 30 additions & 0 deletions .github/workflows/integration-tests-root-bypass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow is required to ensure that required Github check passes even if
# the actual "Integration Tests (Root)" workflow skipped due to path filtering.
# Otherwise it will stay forever pending.
#
# See "Handling skipped but required checks" for more info:
#
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
#
# Note both workflows must have the same name.

name: Integration Tests (Root)
run-name: Skip Integration Tests (Root) - ${{ github.run_id }} - @${{ github.actor }}

on:
pull_request:
paths-ignore:
- '**.go'
- 'go.mod'
- 'go.sum'

jobs:
test:
name: Skipped
runs-on: ubuntu-latest

permissions:
contents: none

steps:
- run: 'echo "No changes to verify"'
14 changes: 12 additions & 2 deletions .github/workflows/unit-tests-code-bypass.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# This workflow is required to ensure that required Github check passes even if
# the actual "Unit Tests (Go)" workflow skipped due to path filtering. Otherwise
# it will stay forever pending.
#
# See "Handling skipped but required checks" for more info:
#
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
#
# Note both workflows must have the same name.

name: Unit Tests (Go)
run-name: Unit Tests (Go) - ${{ github.run_id }} - @${{ github.actor }}
run-name: Skip Unit Tests (Go) - ${{ github.run_id }} - @${{ github.actor }}

on:
pull_request:
Expand All @@ -8,7 +18,7 @@ on:

jobs:
test:
name: Unit Tests (Go)
name: Skipped
runs-on: ubuntu-latest

permissions:
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/unit-tests-helm-bypass.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# This workflow is required to ensure that required Github check passes even if
# the actual "Unit Tests (Helm)" workflow skipped due to path filtering. Otherwise
# it will stay forever pending.
#
# See "Handling skipped but required checks" for more info:
#
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
#
# Note both workflows must have the same name.

name: Unit Tests (Helm)
run-name: Unit Tests (Helm) - ${{ github.run_id }} - @${{ github.actor }}
run-name: Skip Unit Tests (Helm) - ${{ github.run_id }} - @${{ github.actor }}

on:
pull_request:
Expand All @@ -9,7 +18,7 @@ on:

jobs:
test:
name: Unit Tests (Helm)
name: Skipped
runs-on: ubuntu-latest

permissions:
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/unit-tests-operator-bypass.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# This workflow is required to ensure that required Github check passes even if
# the actual "Unit Tests (Operator)" workflow skipped due to path filtering. Otherwise
# it will stay forever pending.
#
# See "Handling skipped but required checks" for more info:
#
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
#
# Note both workflows must have the same name.

name: Unit Tests (Operator)
run-name: Unit Tests (Operator) - ${{ github.run_id }} - @${{ github.actor }}
run-name: Skip Unit Tests (Operator) - ${{ github.run_id }} - @${{ github.actor }}

on:
pull_request:
Expand All @@ -12,7 +22,7 @@ on:

jobs:
test:
name: Unit Tests (Operator)
name: Skipped
runs-on: ubuntu-latest

permissions:
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/unit-tests-rust-bypass.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# This workflow is required to ensure that required Github check passes even if
# the actual "Unit Tests (Rust)" workflow skipped due to path filtering. Otherwise
# it will stay forever pending.
#
# See "Handling skipped but required checks" for more info:
#
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
#
# Note both workflows must have the same name.

name: Unit Tests (Rust)
run-name: Unit Tests (Rust) - ${{ github.run_id }} - @${{ github.actor }}
run-name: Skip Unit Tests (Rust) - ${{ github.run_id }} - @${{ github.actor }}

on:
pull_request:
Expand All @@ -10,7 +20,7 @@ on:

jobs:
test:
name: Unit Tests (Rust)
name: Skipped
runs-on: ubuntu-latest

permissions:
Expand Down
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,13 @@ all: version
@echo "---> Building OSS binaries."
$(MAKE) $(BINARIES)

#
# make binaries builds all binaries defined in the BINARIES environment variable
#
.PHONY: binaries
binaries:
$(MAKE) $(BINARIES)

# By making these 3 targets below (tsh, tctl and teleport) PHONY we are solving
# several problems:
# * Build will rely on go build internal caching https://golang.org/doc/go1.10 at all times
Expand Down Expand Up @@ -909,6 +916,13 @@ sloccount:
remove-temp-files:
find . -name flymake_* -delete

#
# print-go-version outputs Go version as a semver without "go" prefix
#
.PHONY: print-go-version
print-go-version:
@$(MAKE) -C build.assets print-go-version | sed "s/go//"

# Dockerized build: useful for making Linux releases on OSX
.PHONY:docker
docker:
Expand Down
2 changes: 1 addition & 1 deletion api/types/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/gravitational/teleport/api/utils"
)

// User represents teleport embedded user or external user
// User represents teleport embedded user or external user.
type User interface {
// ResourceWithSecrets provides common resource properties
ResourceWithSecrets
Expand Down
2 changes: 1 addition & 1 deletion lib/srv/desktop/rdp/rdpclient/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

fn main() {
// the cwd of build scripts is the root of the crate
// the cwd of build scripts is the root of the crate.
let bindings = cbindgen::Builder::new()
.with_crate(".")
.with_language(cbindgen::Language::C)
Expand Down

0 comments on commit 91f7030

Please sign in to comment.