diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index a6d267f8f4..0000000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,188 +0,0 @@ -name: CI - -on: - push: - branches: - - "main" -jobs: - check: - runs-on: "ubuntu-latest" - steps: - - uses: actions/checkout@v3 - - uses: ./.github/composite/go-setup - - name: Lint - run: make check && make check-templates - - name: Check that 'func.yaml schema' is up-to-date - run: make schema-check - - name: Check embedded templates content - run: go test -run "^\QTestFileSystems\E$/^\Qembedded\E$" ./pkg/filesystem - - test-unit: - strategy: - matrix: - java: [ 21 ] - os: [ "ubuntu-latest", "windows-latest", "macos-latest" ] - runs-on: ${{ matrix.os }} - steps: - - run: git config --global core.autocrlf false - - uses: actions/checkout@v3 - - uses: ./.github/composite/go-setup - - uses: actions/setup-java@v1 - with: - java-version: ${{ matrix.java }} - - name: Unit Test - run: make test - - name: Template Unit Tests - run: make test-templates - - uses: codecov/codecov-action@v3 - with: - files: ./coverage.txt - flags: unit-tests-${{ matrix.os }} - - test-integration: - runs-on: "ubuntu-latest" - steps: - - name: Set Environment Variables - run: | - echo "KUBECONFIG=${{ github.workspace }}/hack/bin/kubeconfig.yaml" >> "$GITHUB_ENV" - echo "PATH=${{ github.workspace }}/hack/bin:$PATH" >> "$GITHUB_ENV" - - uses: actions/checkout@v3 - - uses: ./.github/composite/go-setup - - name: Install Binaries - run: ./hack/install-binaries.sh - - name: Allocate Cluster - run: ./hack/allocate.sh - - name: Local Registry - run: ./hack/registry.sh - - name: Setup testing images - run: ./hack/setup-testing-images.sh - - name: Integration Tests - run: make test-integration - - uses: codecov/codecov-action@v3 - with: - files: ./coverage.txt - flags: integration-tests - - e2e-test: - strategy: - matrix: - os: ["ubuntu-latest"] - runs-on: ${{ matrix.os }} - steps: - - name: Set Environment Variables - run: | - echo "KUBECONFIG=${{ github.workspace }}/hack/bin/kubeconfig.yaml" >> "$GITHUB_ENV" - echo "PATH=${{ github.workspace }}/hack/bin:$PATH" >> "$GITHUB_ENV" - - uses: actions/checkout@v3 - - uses: ./.github/composite/go-setup - - name: Install Binaries - run: ./hack/binaries.sh - - name: Allocate Cluster - run: ./hack/allocate.sh - - name: Local Registry - run: ./hack/registry.sh - - name: E2E Test - run: make test-e2e - - uses: codecov/codecov-action@v3 - with: - files: ./coverage.txt - flags: e2e-test - - e2e-on-cluster-test: - strategy: - matrix: - os: ["ubuntu-latest"] - runs-on: ${{ matrix.os }} - steps: - - name: Set Environment Variables - run: | - echo "KUBECONFIG=${{ github.workspace }}/hack/bin/kubeconfig.yaml" >> "$GITHUB_ENV" - echo "PATH=${{ github.workspace }}/hack/bin:$PATH" >> "$GITHUB_ENV" - - uses: actions/checkout@v3 - - uses: ./.github/composite/go-setup - - uses: imjasonh/setup-ko@v0.6 - - name: Install Binaries - run: ./hack/binaries.sh - - name: Allocate Cluster - run: ./hack/allocate.sh - - name: Setup testing images - run: ./hack/setup-testing-images.sh - - name: Deploy Tekton - run: ./hack/install-tekton.sh - - name: Deploy Test Git Server - run: ./hack/install-git-server.sh - - name: E2E On Cluster Test - env: - E2E_RUNTIMES: "" - run: make test-e2e-on-cluster - - uses: codecov/codecov-action@v3 - with: - files: ./coverage.txt - flags: e2e-test-oncluster - - build: - needs: [check, test-unit, test-integration, e2e-test, e2e-on-cluster-test] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: ./.github/composite/go-setup - # Standard build tasks - - name: Build - run: make cross-platform - # Upload all build artifacts - - uses: actions/upload-artifact@v2 - with: - name: OSX Binary (AMD) - path: func_darwin_amd64 - - uses: actions/upload-artifact@v2 - with: - name: OSX Binary (ARM) - path: func_darwin_arm64 - - uses: actions/upload-artifact@v2 - with: - name: Linux Binary (AMD) - path: func_linux_amd64 - - uses: actions/upload-artifact@v2 - with: - name: Linux Binary (ARM) - path: func_linux_arm64 - - uses: actions/upload-artifact@v2 - with: - name: Linux Binary (PPC64LE) - path: func_linux_ppc64le - - uses: actions/upload-artifact@v2 - with: - name: Linux Binary (S390X) - path: func_linux_s390x - - uses: actions/upload-artifact@v2 - with: - name: Windows Binary - path: func_windows_amd64.exe - - publish-utils-image: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - run: | - docker buildx create --name multiarch --driver docker-container --use - docker buildx build . -f Dockerfile.utils \ - --platform=linux/ppc64le,linux/s390x,linux/amd64,linux/arm64 \ - --push \ - -t "ghcr.io/knative/func-utils:latest" - - publish-image: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: ./.github/composite/go-setup - - uses: imjasonh/setup-ko@v0.6 - - run: ko build --platform=linux/ppc64le,linux/s390x,linux/amd64,linux/arm64 -B ./cmd/func diff --git a/.github/workflows/knative-go-build.yaml b/.github/workflows/knative-go-build.yaml deleted file mode 100644 index 10c3de1a1e..0000000000 --- a/.github/workflows/knative-go-build.yaml +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2020 The Knative Authors. -# SPDX-License-Identifier: Apache-2.0 - -# This file is automagically synced here from github.com/knative-extensions/knobots - -name: Build - -on: - pull_request: - branches: [ 'main', 'release-*' ] - -jobs: - build: - uses: knative/actions/.github/workflows/reusable-go-build.yaml@main diff --git a/.github/workflows/knative-go-test.yaml b/.github/workflows/knative-go-test.yaml deleted file mode 100644 index 75d921e216..0000000000 --- a/.github/workflows/knative-go-test.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2022 The Knative Authors. -# SPDX-License-Identifier: Apache-2.0 - -# This file is automagically synced here from github.com/knative-extensions/knobots - -name: Test - -on: - push: - branches: [ 'main', 'release-*' ] - - pull_request: - branches: [ 'main', 'release-*' ] - -jobs: - test: - uses: knative/actions/.github/workflows/reusable-go-test.yaml@main diff --git a/.github/workflows/knative-security.yaml b/.github/workflows/knative-security.yaml deleted file mode 100644 index a6cd68137a..0000000000 --- a/.github/workflows/knative-security.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2020 The Knative Authors. -# SPDX-License-Identifier: Apache-2.0 - -# This file is automagically synced here from github.com/knative-extensions/knobots - -name: 'Security' - -on: - push: - branches: [ 'main', 'release-*' ] - - pull_request: - branches: [ 'main', 'release-*' ] - -jobs: - analyze: - uses: knative/actions/.github/workflows/reusable-security.yaml@main diff --git a/.github/workflows/knative-stale.yaml b/.github/workflows/knative-stale.yaml deleted file mode 100644 index 2e25b9d99a..0000000000 --- a/.github/workflows/knative-stale.yaml +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2020 The Knative Authors. -# SPDX-License-Identifier: Apache-2.0 - -# This file is automagically synced here from github.com/knative-extensions/knobots -name: 'Close stale' - -on: - schedule: - - cron: '0 1 * * *' - -jobs: - - stale: - uses: knative/actions/.github/workflows/reusable-stale.yaml@main diff --git a/.github/workflows/knative-style.yaml b/.github/workflows/knative-style.yaml deleted file mode 100644 index 55bb1537cc..0000000000 --- a/.github/workflows/knative-style.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2020 The Knative Authors. -# SPDX-License-Identifier: Apache-2.0 - -# This file is automagically synced here from github.com/knative-extensions/knobots - -name: Code Style - -on: - pull_request: - branches: [ 'main', 'release-*' ] - -jobs: - - style: - uses: knative/actions/.github/workflows/reusable-style.yaml@main diff --git a/.github/workflows/knative-verify.yaml b/.github/workflows/knative-verify.yaml deleted file mode 100644 index e1a28c4f50..0000000000 --- a/.github/workflows/knative-verify.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# 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. - -# This file is automagically synced here from github.com/knative-extensions/.github -# repo by knobots: https://github.com/knative-extensions/knobots and will be overwritten. - -name: Verify - -on: - pull_request: - branches: [ 'main', 'release-*' ] - -jobs: - verify: - uses: knative/actions/.github/workflows/reusable-verify-codegen.yaml@main diff --git a/.github/workflows/test-e2e-oncluster-runtime.yaml b/.github/workflows/test-e2e-oncluster-runtime.yaml deleted file mode 100644 index 97f2e26327..0000000000 --- a/.github/workflows/test-e2e-oncluster-runtime.yaml +++ /dev/null @@ -1,53 +0,0 @@ -name: Func E2E OnCluster RT Test - -on: [pull_request] - -jobs: - test: - name: On Cluster RT Test - continue-on-error: true - strategy: - matrix: - os: ["ubuntu-latest"] - func_builder: ["pack", "s2i"] - runs-on: ${{ matrix.os }} - steps: - - name: Set Environment Variables - run: | - echo "KUBECONFIG=${{ github.workspace }}/hack/bin/kubeconfig.yaml" >> "$GITHUB_ENV" - echo "PATH=${{ github.workspace }}/hack/bin:$PATH" >> "$GITHUB_ENV" - - uses: actions/checkout@v3 - - uses: ./.github/composite/go-setup - - uses: imjasonh/setup-ko@v0.6 - - name: Install Binaries - run: ./hack/install-binaries.sh - - name: Allocate Cluster - run: ./hack/allocate.sh - - name: Setup testing images - run: ./hack/setup-testing-images.sh - - name: Deploy Tekton - run: ./hack/install-tekton.sh - - name: Deploy Test Git Server - run: ./hack/install-git-server.sh - - name: E2E On Cluster Test (Runtimes) - env: - TEST_TAGS: runtime - E2E_REGISTRY_URL: registry.default.svc.cluster.local:5000 - FUNC_REPO_REF: ${{ github.event.pull_request.head.repo.full_name }} - FUNC_REPO_BRANCH_REF: ${{ github.head_ref }} - FUNC_BUILDER: ${{ matrix.func_builder }} - run: make test-e2e-on-cluster - - name: Dump Cluster Logs - if: always() - run: | - echo "::group::cluster events" - kubectl get events -A - echo "::endgroup::" - - echo "::group::cluster containers logs" - stern '.*' --all-namespaces --no-follow - echo "::endgroup::" - - uses: codecov/codecov-action@v3 - with: - files: ./coverage.txt - flags: e2e-test-oncluster-runtime diff --git a/.github/workflows/test-e2e-oncluster.yaml b/.github/workflows/test-e2e-oncluster.yaml deleted file mode 100644 index 62e6d0245e..0000000000 --- a/.github/workflows/test-e2e-oncluster.yaml +++ /dev/null @@ -1,39 +0,0 @@ -name: Func E2E OnCluster Test - -on: [pull_request] - -jobs: - test: - name: On Cluster Test - strategy: - matrix: - os: ["ubuntu-latest"] - runs-on: ${{ matrix.os }} - steps: - - name: Set Environment Variables - run: | - echo "KUBECONFIG=${{ github.workspace }}/hack/bin/kubeconfig.yaml" >> "$GITHUB_ENV" - echo "PATH=${{ github.workspace }}/hack/bin:$PATH" >> "$GITHUB_ENV" - - uses: actions/checkout@v3 - - uses: ./.github/composite/go-setup - - uses: imjasonh/setup-ko@v0.6 - - name: Install Binaries - run: ./hack/install-binaries.sh - - name: Allocate Cluster - run: ./hack/allocate.sh - - name: Setup testing images - run: ./hack/setup-testing-images.sh - - name: Deploy Tekton - run: ./hack/install-tekton.sh - - name: Deploy Test Git Server - run: ./hack/install-git-server.sh - - name: E2E On Cluster Test - env: - E2E_RUNTIMES: "" - FUNC_REPO_REF: ${{ github.event.pull_request.head.repo.full_name }} - FUNC_REPO_BRANCH_REF: ${{ github.head_ref }} - run: make test-e2e-on-cluster - - uses: codecov/codecov-action@v3 - with: - files: ./coverage.txt - flags: e2e-test-oncluster diff --git a/.github/workflows/test-e2e-runtime.yaml b/.github/workflows/test-e2e-runtime.yaml deleted file mode 100644 index 54a3f696c3..0000000000 --- a/.github/workflows/test-e2e-runtime.yaml +++ /dev/null @@ -1,37 +0,0 @@ -name: Func E2E Lifecycle Test - -on: [pull_request] - -concurrency: - group: ci-e1e-${{ github.ref }}-1 - cancel-in-progress: true - -jobs: - test: - name: E2E Test - continue-on-error: true - strategy: - matrix: - runtime: ["node", "go", "python", "quarkus", "springboot", "typescript", "rust"] - runs-on: ubuntu-latest - steps: - - name: Set Environment Variables - run: | - echo "KUBECONFIG=${{ github.workspace }}/hack/bin/kubeconfig.yaml" >> "$GITHUB_ENV" - echo "PATH=${{ github.workspace }}/hack/bin:$PATH" >> "$GITHUB_ENV" - - uses: actions/checkout@v3 - - uses: ./.github/composite/go-setup - - name: Install Binaries - run: ./hack/install-binaries.sh - - name: Allocate Cluster - run: ./hack/allocate.sh - - name: Local Registry - run: ./hack/registry.sh - - name: Build - run: make - - name: E2E runtime for ${{ matrix.runtime }} - run: make test-e2e-runtime runtime=${{ matrix.runtime }} - - uses: codecov/codecov-action@v3 - with: - files: ./coverage.txt - flags: e2e-test-runtime-${{ matrix.runtime }} diff --git a/.github/workflows/test-e2e.yaml b/.github/workflows/test-e2e.yaml deleted file mode 100644 index eee05c291c..0000000000 --- a/.github/workflows/test-e2e.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: Func E2E Test - -on: [pull_request] - -jobs: - test: - name: E2E Test - strategy: - matrix: - os: ["ubuntu-latest"] - runs-on: ${{ matrix.os }} - steps: - - name: Set Environment Variables - run: | - echo "KUBECONFIG=${{ github.workspace }}/hack/bin/kubeconfig.yaml" >> "$GITHUB_ENV" - echo "PATH=${{ github.workspace }}/hack/bin:$PATH" >> "$GITHUB_ENV" - - uses: actions/checkout@v3 - - uses: ./.github/composite/go-setup - - name: Install Binaries - run: ./hack/install-binaries.sh - - name: Allocate Cluster - run: ./hack/allocate.sh - - name: Local Registry - run: ./hack/registry.sh - - name: E2E Test - run: make test-e2e - - uses: codecov/codecov-action@v3 - with: - files: ./coverage.txt - flags: e2e-test diff --git a/.github/workflows/test-embedded-fs.yaml b/.github/workflows/test-embedded-fs.yaml deleted file mode 100644 index 04bb6147da..0000000000 --- a/.github/workflows/test-embedded-fs.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: Func Embedded FS Test - -on: [pull_request] - -jobs: - test: - name: Func Embedded FS Test - strategy: - matrix: - os: ["ubuntu-latest"] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - - uses: ./.github/composite/go-setup - - name: Check embedded templates content - run: | - if ! go test -run "^\QTestFileSystems\E$/^\Qembedded\E$" ./pkg/filesystem; then - echo "Content of templates directory and embedded FS (zz_filesystem_generated.go) doesn't match!" - echo "Consult https:.github.com/knative/func/blob/main/docs/CONTRIBUTING.md#templates ." - exit 1 - fi diff --git a/Makefile b/Makefile index be37e4f5ac..b206db55de 100644 --- a/Makefile +++ b/Makefile @@ -197,6 +197,7 @@ templates/certs/ca-certificates.crt: ################### test-integration: ## Run integration tests using an available cluster. + env go test -ldflags "$(LDFLAGS)" -tags integration -timeout 30m --coverprofile=coverage.txt ./... -v .PHONY: func-instrumented