knative.dev/pkg@v0.0.0-20260602142205-ac97e43f6622/.github/workflows/knative-downstream.yaml (about)

     1  # Copyright 2020 The Knative Authors.
     2  #
     3  # Licensed under the Apache License, Version 2.0 (the "License");
     4  # you may not use this file except in compliance with the License.
     5  # You may obtain a copy of the License at
     6  #
     7  #     http://www.apache.org/licenses/LICENSE-2.0
     8  #
     9  # Unless required by applicable law or agreed to in writing, software
    10  # distributed under the License is distributed on an "AS IS" BASIS,
    11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  # See the License for the specific language governing permissions and
    13  # limitations under the License.
    14  
    15  name: Downstream Knative
    16  
    17  on:
    18    pull_request:
    19      branches: [ 'main', 'release-*' ]
    20  
    21  jobs:
    22  
    23    downstream-knative:
    24      name: Unit Test
    25      strategy:
    26        fail-fast: false # Keep running if one leg fails.
    27        matrix:
    28          repo:
    29            - knative/serving
    30            - knative/networking
    31            - knative/eventing
    32            - knative/operator
    33            - knative/client
    34            - knative-extensions/eventing-autoscaler-keda
    35            - knative-extensions/eventing-ceph
    36            - knative-extensions/eventing-github
    37            - knative-extensions/eventing-gitlab
    38            - knative-extensions/eventing-kafka-broker
    39            - knative-extensions/eventing-rabbitmq
    40            - knative-extensions/eventing-redis
    41            - knative-extensions/kn-plugin-admin
    42            - knative-extensions/net-contour
    43            - knative-extensions/net-istio
    44            - knative-extensions/net-kourier
    45  
    46      runs-on: ubuntu-latest
    47  
    48      steps:
    49      - name: Set up Go
    50        uses: knative/actions/setup-go@main
    51  
    52      - name: Checkout upstream at ${{ github.base_ref }}
    53        uses: actions/checkout@v6
    54        with:
    55          fetch-depth: 0
    56          path: upstream
    57  
    58      - name: Merge upstream
    59        if: github.event_name == 'pull_request'
    60        shell: bash
    61        working-directory: upstream
    62        run: |
    63           if ! git config user.name > /dev/null; then
    64             git config user.name "Knative Action"
    65           fi
    66           if ! git config user.email > /dev/null; then
    67             git config user.email "action@knative.dev"
    68           fi
    69           git remote add upstream https://github.com/${{ github.repository }}.git
    70           git fetch upstream ${{ github.base_ref }}
    71           git pull --no-rebase --no-commit upstream ${{ github.base_ref }}
    72  
    73      - name: Attempt checkout of downstream at ${{ github.base_ref }}
    74        id: checkout-downstream
    75        uses: actions/checkout@v6
    76        with:
    77          ref: ${{ github.base_ref }}
    78          repository: ${{ matrix.repo }}
    79          path: downstream
    80        continue-on-error: true
    81  
    82      - name: Checkout downstream with fallback branch
    83        if: steps.checkout-downstream.outcome == 'failure'
    84        uses: actions/checkout@v6
    85        with:
    86          ref: main
    87          repository: ${{ matrix.repo }}
    88          path: downstream
    89  
    90      - name: Test downstream
    91        uses: knative/actions/go/downstream-test@main
    92        with:
    93          upstream-path: upstream
    94          downstream-path: downstream