diff --git a/.github/workflows/benchmark.yaml b/.github/workflows/benchmark.yaml index c4a0226ef5..bd3af99c22 100644 --- a/.github/workflows/benchmark.yaml +++ b/.github/workflows/benchmark.yaml @@ -3,9 +3,6 @@ on: push: branches: - main - pull_request: - # The branches below must be a subset of the branches above - branches: [main] permissions: read-all diff --git a/.github/workflows/branch-cov.yaml b/.github/workflows/branch-cov.yaml index ccd44b5153..eea36a954e 100644 --- a/.github/workflows/branch-cov.yaml +++ b/.github/workflows/branch-cov.yaml @@ -3,9 +3,6 @@ on: push: branches: - main - pull_request: - # The branches below must be a subset of the branches above - branches: [main] permissions: read-all diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1c9d6576d0..66a52dcbd2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -2,12 +2,6 @@ on: push: branches: - main - pull_request: - branches: - - main - release: - types: - - published name: build permissions: read-all diff --git a/.github/workflows/cluster.yaml b/.github/workflows/cluster.yaml index 22c5266dc1..c727abf635 100644 --- a/.github/workflows/cluster.yaml +++ b/.github/workflows/cluster.yaml @@ -3,11 +3,6 @@ on: push: branches: - main - pull_request: - branches: [main] - release: - types: - - published permissions: read-all diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 76992afcf4..4e1d15d391 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -13,12 +13,8 @@ name: "CodeQL" on: push: - branches: [ main ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ main ] - schedule: - - cron: '17 11 * * 0' + branches: + - main permissions: read-all diff --git a/.github/workflows/compare-binary-size.yaml b/.github/workflows/compare-binary-size.yaml index 652f08f41e..a523a4c7e6 100644 --- a/.github/workflows/compare-binary-size.yaml +++ b/.github/workflows/compare-binary-size.yaml @@ -1,7 +1,8 @@ name: "Check binary size increase" on: - pull_request: - branches: [main] + push: + branches: + - main permissions: read-all diff --git a/.github/workflows/ecosystem-tools.yaml b/.github/workflows/ecosystem-tools.yaml index c27183a52c..ea60b0df75 100644 --- a/.github/workflows/ecosystem-tools.yaml +++ b/.github/workflows/ecosystem-tools.yaml @@ -3,11 +3,6 @@ on: push: branches: - main - pull_request: - branches: [main] - release: - types: - - published permissions: read-all diff --git a/.github/workflows/gc-stress-test.yaml b/.github/workflows/gc-stress-test.yaml index d0d62af637..f1b117876d 100644 --- a/.github/workflows/gc-stress-test.yaml +++ b/.github/workflows/gc-stress-test.yaml @@ -3,11 +3,6 @@ on: push: branches: - main - pull_request: - branches: [main] - release: - types: - - published permissions: read-all diff --git a/.github/workflows/gqlgen.yaml b/.github/workflows/gqlgen.yaml index 2273c192f2..8016eda3e9 100644 --- a/.github/workflows/gqlgen.yaml +++ b/.github/workflows/gqlgen.yaml @@ -8,11 +8,6 @@ on: push: branches: - main - pull_request: - branches: [main] - release: - types: - - published permissions: read-all diff --git a/.github/workflows/kind.yaml b/.github/workflows/kind.yaml new file mode 100644 index 0000000000..d20b117595 --- /dev/null +++ b/.github/workflows/kind.yaml @@ -0,0 +1,43 @@ +name: 'Kind setup' +on: + push: + branches: + - main + pull_request: + branches: + - main + +permissions: read-all + +jobs: + kind-setup: + name: Prometheus setup + runs-on: ubuntu-latest-16-cores + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/clean-runner + - uses: actions/setup-go@v3 + with: + go-version: 1.20.x + - name: Install dependencies + run: | + cd $GITHUB_WORKSPACE + go mod download + sudo apt-get update + sudo apt-get install libgpgme-dev libassuan-dev libbtrfs-dev libdevmapper-dev pkg-config rpm uidmap + # install skopeo + git clone -b v1.12.0 https://github.com/containers/skopeo.git + cd skopeo + make bin/skopeo + sudo cp bin/skopeo /usr/bin + skopeo -v + - name: Log in to GitHub Docker Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ github.token }} + - name: Run tests + run: | + ./examples/kind/kind-ci.sh + diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5b57c1a5a7..c00db2b932 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,11 +3,6 @@ on: push: branches: - main - pull_request: - branches: [main] - release: - types: - - published permissions: read-all diff --git a/.github/workflows/tls.yaml b/.github/workflows/tls.yaml index 478fa0369c..9f340c3d0d 100644 --- a/.github/workflows/tls.yaml +++ b/.github/workflows/tls.yaml @@ -3,9 +3,6 @@ on: push: branches: - main - pull_request: - # The branches below must be a subset of the branches above - branches: [main] permissions: read-all diff --git a/.github/workflows/web-scan.yaml b/.github/workflows/web-scan.yaml index b703f6c550..cf165e88c6 100644 --- a/.github/workflows/web-scan.yaml +++ b/.github/workflows/web-scan.yaml @@ -3,12 +3,6 @@ on: push: branches: - main - pull_request: - branches: - - main - release: - types: - - published permissions: contents: read diff --git a/examples/kind/kind-ci.sh b/examples/kind/kind-ci.sh new file mode 100755 index 0000000000..d55e39494f --- /dev/null +++ b/examples/kind/kind-ci.sh @@ -0,0 +1,106 @@ +#!/bin/sh +set -o errexit + +# Reference: https://kind.sigs.k8s.io/docs/user/local-registry/ + +# set no_proxy if applicable +if [ ! -z "${no_proxy}" ]; then + echo "Updating no_proxy env var"; + export no_proxy=${no_proxy},kind-registry; + export NO_PROXY=${no_proxy}; +fi + +# create registry container unless it already exists +reg_name='kind-registry' +reg_port='5001' +if [ "$(docker inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null || true)" != 'true' ]; then + docker run \ + -d --restart=always -p "127.0.0.1:${reg_port}:5000" --name "${reg_name}" \ + ghcr.io/project-zot/zot-minimal-linux-amd64:latest +fi + +CLUSTER_NAME=kind +## Delete the cluster if it already exist +kind get clusters | grep ${CLUSTER_NAME} && kind delete cluster --name ${CLUSTER_NAME} + +# create a cluster with the local registry enabled in containerd +cat <