|
| 1 | +# |
| 2 | +# Copyright 2021-2022 Red Hat, Inc. |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | + |
| 16 | +name: Validate stacks |
| 17 | + |
| 18 | +on: |
| 19 | + push: |
| 20 | + branches: [main] |
| 21 | + pull_request: |
| 22 | + branches: [main] |
| 23 | + schedule: |
| 24 | + - cron: 0 5 * * * |
| 25 | + |
| 26 | +concurrency: |
| 27 | + group: ${{ github.workflow }}-${{ github.event.number || github.ref }} |
| 28 | + cancel-in-progress: true |
| 29 | + |
| 30 | +env: |
| 31 | + MINIKUBE_VERSION: "v1.29.0" |
| 32 | + MINIKUBE_RESOURCES: "--memory 14gb --cpus 4" |
| 33 | + KUBERNETES_VERSION: "v1.25.2" |
| 34 | + TEST_DELTA: false |
| 35 | + |
| 36 | +jobs: |
| 37 | + validate-devfile-schema: |
| 38 | + name: validate devfile schemas |
| 39 | + runs-on: ubuntu-latest |
| 40 | + steps: |
| 41 | + - name: Checkout |
| 42 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 43 | + with: |
| 44 | + fetch-depth: 0 |
| 45 | + |
| 46 | + - name: Install Go |
| 47 | + uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 |
| 48 | + with: |
| 49 | + go-version: "1.23" |
| 50 | + |
| 51 | + - name: Install Ginkgo |
| 52 | + run: go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo@v2.13.0 |
| 53 | + |
| 54 | + - name: Test delta if on a pull request |
| 55 | + if: ${{ github.event_name == 'pull_request' }} |
| 56 | + run: echo "TEST_DELTA=true" >> $GITHUB_ENV |
| 57 | + |
| 58 | + - name: Validate stacks |
| 59 | + run: bash tests/validate_devfile_schemas.sh |
| 60 | + |
| 61 | + non-terminating: |
| 62 | + name: check for non-terminating images |
| 63 | + runs-on: ubuntu-latest |
| 64 | + steps: |
| 65 | + - name: Checkout |
| 66 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 67 | + with: |
| 68 | + fetch-depth: 0 |
| 69 | + |
| 70 | + - name: Setup Minikube |
| 71 | + uses: manusa/actions-setup-minikube@0e8062ceff873bd77979f39cf8fd3621416afe4d # v2.13.0 |
| 72 | + with: |
| 73 | + minikube version: ${{ env.MINIKUBE_VERSION }} |
| 74 | + kubernetes version: ${{ env.KUBERNETES_VERSION }} |
| 75 | + driver: "docker" |
| 76 | + github token: ${{ secrets.GITHUB_TOKEN }} |
| 77 | + start args: "--addons=ingress ${{ env.MINIKUBE_RESOURCES }}" |
| 78 | + |
| 79 | + - name: Test delta if on a pull request |
| 80 | + if: ${{ github.event_name == 'pull_request' }} |
| 81 | + run: echo "TEST_DELTA=true" >> $GITHUB_ENV |
| 82 | + |
| 83 | + - name: Check that containers components are non terminating |
| 84 | + run: | |
| 85 | + go build -C tests/check_non_terminating -o flatten-parent |
| 86 | + bash tests/check_non_terminating.sh |
| 87 | +
|
| 88 | + odov3: |
| 89 | + name: with odo v3 |
| 90 | + runs-on: ubuntu-latest |
| 91 | + needs: [odov2, non-terminating, validate-devfile-schema] |
| 92 | + if: success() || failure() |
| 93 | + steps: |
| 94 | + - name: Checkout |
| 95 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 96 | + with: |
| 97 | + fetch-depth: 0 |
| 98 | + |
| 99 | + - name: Free Disk Space |
| 100 | + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be #v1.3.1 |
| 101 | + with: |
| 102 | + tool-cache: false |
| 103 | + android: true |
| 104 | + dotnet: true |
| 105 | + haskell: true |
| 106 | + large-packages: true |
| 107 | + docker-images: true |
| 108 | + swap-storage: true |
| 109 | + |
| 110 | + - name: Setup Minikube |
| 111 | + uses: manusa/actions-setup-minikube@0e8062ceff873bd77979f39cf8fd3621416afe4d # v2.13.0 |
| 112 | + with: |
| 113 | + minikube version: ${{ env.MINIKUBE_VERSION }} |
| 114 | + kubernetes version: ${{ env.KUBERNETES_VERSION }} |
| 115 | + driver: "docker" |
| 116 | + github token: ${{ secrets.GITHUB_TOKEN }} |
| 117 | + start args: "--addons=ingress ${{ env.MINIKUBE_RESOURCES }}" |
| 118 | + |
| 119 | + - name: Install Go |
| 120 | + uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 |
| 121 | + with: |
| 122 | + go-version: "1.23" |
| 123 | + |
| 124 | + - name: Install odo latest version v3 |
| 125 | + uses: redhat-actions/openshift-tools-installer@2de9a80cf012ad0601021515481d433b91ef8fd5 # v1 |
| 126 | + with: |
| 127 | + odo: "3.16.1" |
| 128 | + |
| 129 | + - name: Install Ginkgo |
| 130 | + run: go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo@v2.13.0 |
| 131 | + |
| 132 | + - name: Check odo version |
| 133 | + run: odo version |
| 134 | + |
| 135 | + - name: Test delta if on a pull request |
| 136 | + if: ${{ github.event_name == 'pull_request' }} |
| 137 | + run: echo "TEST_DELTA=true" >> $GITHUB_ENV |
| 138 | + |
| 139 | + - name: Check the devfile stacks with odo v3 |
| 140 | + run: bash tests/check_odov3.sh |
0 commit comments