Skip to content

Commit 0c26f21

Browse files
committed
ci: run functional test suite on a kind cluster
Adds .github/workflows/functional.yml. The job provisions an ephemeral Kubernetes cluster with kind and runs the test/functional module against it; TestMain deploys zot from testdata/k8s and the tests exercise the public API end-to-end. Runs on pushes and PRs to main that touch Go sources or the functional suite. Actions are pinned to commit SHAs per repo convention. Signed-off-by: Terry Howe <terrylhowe@gmail.com>
1 parent ac592ae commit 0c26f21

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

.github/workflows/functional.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Copyright The ORAS Authors.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
14+
name: functional
15+
16+
on:
17+
push:
18+
branches:
19+
- main
20+
paths:
21+
- '**/*.go'
22+
- 'go.mod'
23+
- 'go.sum'
24+
- 'test/functional/**'
25+
- '.github/workflows/functional.yml'
26+
pull_request:
27+
branches:
28+
- main
29+
paths:
30+
- '**/*.go'
31+
- 'go.mod'
32+
- 'go.sum'
33+
- 'test/functional/**'
34+
- '.github/workflows/functional.yml'
35+
36+
permissions:
37+
contents: read
38+
39+
concurrency:
40+
group: functional-${{ github.ref }}
41+
cancel-in-progress: true
42+
43+
jobs:
44+
functional:
45+
runs-on: ubuntu-latest
46+
timeout-minutes: 30
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
50+
- name: Set up Go environment
51+
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
52+
with:
53+
go-version: '1.25'
54+
check-latest: true
55+
- name: Create kind cluster
56+
# Writes a kubeconfig to the default path (~/.kube/config), which the
57+
# suite's buildKubeConfig() reads. TestMain deploys zot into the
58+
# cluster from test/functional/testdata/k8s.
59+
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
60+
- name: Run functional tests
61+
working-directory: test/functional
62+
run: go test -v -timeout 25m ./...

0 commit comments

Comments
 (0)