Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into bugfix/enforce-init…
Browse files Browse the repository at this point in the history
…-flags
  • Loading branch information
cardil committed Feb 28, 2023
2 parents 043e296 + 83f7512 commit f06f7cb
Show file tree
Hide file tree
Showing 2,472 changed files with 563,211 additions and 31,804 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/go-test-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Copyright 2022 The Knative Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Test

on:
push:
branches: [ 'main', 'release-*' ]
pull_request:
branches: [ 'main', 'release-*' ]

jobs:

test:
name: Unit Tests on Windows
runs-on: windows-latest

steps:

- name: Set up Go 1.18
uses: actions/setup-go@v3
with:
go-version: 1.18.x
id: go

- name: Set git autocrlf to input
run: git config --global core.autocrlf input
id: git-crlf

- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Merge upstream
if: github.event_name == 'pull_request'
run: |
if ! git config user.name > /dev/null; then
git config user.name "John Doe"
fi
if ! git config user.email > /dev/null; then
git config user.email "johndoe@localhost"
fi
git remote add upstream https://github.com/${{ github.repository }}.git
git fetch upstream ${{ github.base_ref }}
git pull --no-rebase --no-commit upstream ${{ github.base_ref }}
shell: bash

- name: Test
run: go run gotest.tools/[email protected]
--format testname
--junitfile "tmp/junit_tests.xml"
--junitfile-testsuite-name relative
--junitfile-testcase-classname relative
--jsonfile "tmp/logfile.jsonl" --
-race -count=1 -short ./...
19 changes: 4 additions & 15 deletions .github/workflows/kind-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,15 @@ jobs:
e2e-tests:
strategy:
matrix:
go-version: [ 1.16.x ]
go-version: [ 1.18.x ]
platform: [ ubuntu-latest ]
ko-version: [ 0.8.1 ]
kind-version: [ 0.11.1 ]
kind-version: [ 0.14.0 ]

name: e2e tests
runs-on: ${{ matrix.platform }}

env:
GOPATH: ${{ github.workspace }}
GO111MODULE: off
KO_DOCKER_REPO: kind.local
KO_VERSION: ${{ matrix.ko-version }}
KIND_VERSION: ${{ matrix.kind-version }}

steps:
Expand All @@ -33,14 +29,6 @@ jobs:
go-version: ${{ matrix.go-version }}
id: go

- name: Install Dependencies
run: |
echo '::group:: install ko ${KO_VERSION}'
curl -L https://github.com/google/ko/releases/download/v${KO_VERSION}/ko_${KO_VERSION}_Linux_x86_64.tar.gz | tar xzf - ko
chmod +x ./ko
sudo mv ko /usr/local/bin
echo '::endgroup::'
- name: Check out code onto GOPATH
uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -96,7 +84,8 @@ jobs:
kubectl apply -f ./test/config
# Run the tests tagged as e2e on the KinD cluster.
go test -v -race -count=1 -timeout=15m -tags=e2e ./test/...
go run gotest.tools/[email protected] --format testname -- \
-race -count=1 -timeout=15m -tags=e2e ./test/...
- name: Gather Failure Data
if: ${{ failure() }}
Expand Down
42 changes: 18 additions & 24 deletions .github/workflows/knative-downstream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,42 +25,36 @@ jobs:
strategy:
fail-fast: false # Keep running if one leg fails.
matrix:
include:
- repo: eventing
org: knative
- repo: discovery
org: knative-sandbox
- repo: eventing-rabbitmq
org: knative-sandbox
- repo: eventing-natss
org: knative-sandbox
- repo: eventing-kafka
org: knative-sandbox
- repo: eventing-kafka-broker
org: knative-sandbox
repo:
- knative/eventing
- knative-sandbox/eventing-rabbitmq
- knative-sandbox/eventing-natss
- knative-sandbox/eventing-kafka
- knative-sandbox/eventing-kafka-broker
- knative-sandbox/kn-plugin-event

runs-on: ubuntu-latest
env:
GOPATH: ${{ github.workspace }}
steps:
- name: Set up Go 1.17.x
- name: Set up Go 1.18.x
uses: actions/setup-go@v2
with:
go-version: 1.17.x
go-version: 1.18.x
- name: Install Dependencies
run: |
go get github.com/google/go-licenses
go install github.com/google/go-licenses@latest
- name: Checkout Upstream
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: ./src/knative.dev/${{ github.event.repository.name }}
path: upstream
- name: Checkout Downstream
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: ${{ matrix.org }}/${{ matrix.repo }}
path: ./src/knative.dev/${{ matrix.repo }}
repository: ${{ matrix.repo }}
path: downstream
- name: Test Downstream
uses: knative-sandbox/actions-downstream-test@v1
uses: knative/actions/go/downstream-test@main
with:
upstream-module: knative.dev/${{ github.event.repository.name }}
downstream-module: knative.dev/${{ matrix.repo }}
upstream-path: upstream
downstream-path: downstream
59 changes: 4 additions & 55 deletions .github/workflows/knative-go-build.yaml
Original file line number Diff line number Diff line change
@@ -1,65 +1,14 @@
# Copyright 2020 The Knative Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-License-Identifier: Apache-2.0

# This file is automagically synced here from github.com/knative-sandbox/.github
# repo by knobots: https://github.com/knative-sandbox/knobots and will be overwritten.
# This file is automagically synced here from github.com/knative-sandbox/knobots

name: Build

on:
pull_request:
branches: [ 'main', 'master', 'release-*' ]
branches: [ 'main', 'release-*' ]

jobs:

build:
name: Build
strategy:
matrix:
go-version: [1.17.x]
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}

steps:

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go

- name: Check out code
uses: actions/checkout@v2

- id: go_mod
uses: andstor/file-existence-action@v1
with:
files: go.mod

- name: Build
if: ${{ steps.go_mod.outputs.files_exists == 'true' }}
run: |
tags="$(grep -I -r '// +build' . | \
grep -v '^./vendor/' | \
grep -v '^./hack/' | \
grep -v '^./third_party' | \
cut -f3 -d' ' | \
tr ',' '\n' | \
sort | uniq | \
grep -v '^!' | \
tr '\n' ' ')"
echo "Building with tags: ${tags}"
go test -vet=off -tags "${tags}" -exec echo ./...
uses: knative/actions/.github/workflows/go-build.yaml@main
76 changes: 6 additions & 70 deletions .github/workflows/knative-go-test.yaml
Original file line number Diff line number Diff line change
@@ -1,81 +1,17 @@
# Copyright 2020 The Knative Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Copyright 2022 The Knative Authors.
# SPDX-License-Identifier: Apache-2.0

# This file is automagically synced here from github.com/knative-sandbox/.github
# repo by knobots: https://github.com/knative-sandbox/knobots and will be overwritten.
# This file is automagically synced here from github.com/knative-sandbox/knobots

name: Test

on:

push:
branches: [ 'main', 'master' ]
branches: [ 'main', 'release-*' ]

pull_request:
branches: [ 'main', 'master', 'release-*' ]
branches: [ 'main', 'release-*' ]

jobs:

test:
name: Unit Tests
strategy:
matrix:
go-version: [1.17.x]
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}

steps:

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go

- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Merge upstream
if: github.event_name == 'pull_request'
run: |
if ! git config user.name > /dev/null; then
git config user.name "John Doe"
fi
if ! git config user.email > /dev/null; then
git config user.email "johndoe@localhost"
fi
git remote add upstream https://github.com/${{ github.repository }}.git
git fetch upstream ${{ github.base_ref }}
git pull --no-rebase --no-commit upstream ${{ github.base_ref }}
shell: bash

- name: Check for .codecov.yaml
id: codecov-enabled
uses: andstor/file-existence-action@v1
with:
files: .codecov.yaml

- if: steps.codecov-enabled.outputs.files_exists == 'true'
name: Produce Go Coverage
run: echo 'COVER_OPTS=-coverprofile=coverage.txt -covermode=atomic' >> $GITHUB_ENV

- name: Test
run: go test -race $COVER_OPTS ./...

- if: steps.codecov-enabled.outputs.files_exists == 'true'
name: Codecov
uses: codecov/codecov-action@v1
uses: knative/actions/.github/workflows/go-test.yaml@main
Loading

0 comments on commit f06f7cb

Please sign in to comment.