|
| 1 | +name: Validate with Devfile Registry Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.event.number || github.ref }} |
| 12 | + cancel-in-progress: true |
| 13 | + |
| 14 | +env: |
| 15 | + MINIKUBE_VERSION: 'v1.29.0' |
| 16 | + MINIKUBE_RESOURCES: '--memory 14gb --cpus 4' |
| 17 | + KUBERNETES_VERSION: 'v1.25.2' |
| 18 | + TEST_DELTA: false |
| 19 | + REGISTRY_PATH: ${{ github.workspace }}/registry |
| 20 | + GO_VERSION: '1.23' |
| 21 | + GINKGO_VERSION: v2.19.0 |
| 22 | + YQ_VERSION: v4.44.1 |
| 23 | + |
| 24 | +jobs: |
| 25 | + validate-devfile-schema: |
| 26 | + name: validate devfile schemas |
| 27 | + runs-on: ubuntu-latest |
| 28 | + steps: |
| 29 | + - name: Checkout current repo |
| 30 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 31 | + with: |
| 32 | + path: current-repo |
| 33 | + |
| 34 | + - name: Checkout devfile registry |
| 35 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 36 | + with: |
| 37 | + repository: devfile/registry |
| 38 | + path: ${{ env.REGISTRY_PATH }} |
| 39 | + |
| 40 | + - name: Setup Go |
| 41 | + uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 |
| 42 | + with: |
| 43 | + go-version: ${{ env.GO_VERSION }} |
| 44 | + |
| 45 | + - name: Install yq |
| 46 | + run: | |
| 47 | + curl -sL -O https://github.com/mikefarah/yq/releases/download/${{ env.YQ_VERSION }}/yq_linux_amd64 -o /usr/local/bin/yq && mv ./yq_linux_amd64 /usr/local/bin/yq && chmod +x /usr/local/bin/yq |
| 48 | +
|
| 49 | + - name: Install Ginkgo |
| 50 | + run: go install github.com/onsi/ginkgo/v2/ginkgo@${{ env.GINKGO_VERSION }} |
| 51 | + |
| 52 | + - name: Validate sample |
| 53 | + run: (cd ${{ env.REGISTRY_PATH }} && bash tests/validate_devfile_schemas.sh --stacksPath ${{ github.workspace }} --stackDirs current-repo) |
| 54 | + |
| 55 | + non-terminating: |
| 56 | + name: check for non-terminating images |
| 57 | + runs-on: ubuntu-latest |
| 58 | + steps: |
| 59 | + - name: Checkout |
| 60 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 61 | + with: |
| 62 | + path: current-repo |
| 63 | + fetch-depth: 0 |
| 64 | + |
| 65 | + - name: Checkout devfile registry |
| 66 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 67 | + with: |
| 68 | + repository: devfile/registry |
| 69 | + path: ${{ env.REGISTRY_PATH }} |
| 70 | + |
| 71 | + - name: Setup Go |
| 72 | + uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 |
| 73 | + with: |
| 74 | + go-version: ${{ env.GO_VERSION }} |
| 75 | + |
| 76 | + - name: Setup Minikube |
| 77 | + uses: manusa/actions-setup-minikube@0e8062ceff873bd77979f39cf8fd3621416afe4d # v2.13.0 |
| 78 | + with: |
| 79 | + minikube version: ${{ env.MINIKUBE_VERSION }} |
| 80 | + kubernetes version: ${{ env.KUBERNETES_VERSION }} |
| 81 | + driver: "docker" |
| 82 | + github token: ${{ secrets.GITHUB_TOKEN }} |
| 83 | + start args: "--addons=ingress ${{ env.MINIKUBE_RESOURCES }}" |
| 84 | + |
| 85 | + - name: Check that containers components are non terminating |
| 86 | + run: | |
| 87 | + go build -C ${{ env.REGISTRY_PATH }}/tests/check_non_terminating -o flatten-parent |
| 88 | + (cd ${{ env.REGISTRY_PATH }} && bash ${{ env.REGISTRY_PATH }}/tests/check_non_terminating.sh --stacksPath ${{ github.workspace }} --stackDirs current-repo) |
0 commit comments