Skip to content

Commit

Permalink
ci: add zot compatibility tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
  • Loading branch information
rchincha committed Dec 6, 2022
1 parent b89736e commit c554d34
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/ecosystem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Copyright The ORAS Authors.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: ecosystem

on:
push:
branches:
- main
- release-*
pull_request:
branches:
- main
- release-*
jobs:
zot:
uses: ./.github/workflows/zot.yml
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
check-latest: true
- name: Build CLI
run: make build-linux-amd64
- name: Run Compatibility Tests
run: |
cd $GITHUB_WORKSPACE/
echo "{\"name\":\"foo\",\"value\":\"bar\"}" > config.json
echo "hello world" > artifact.txt
${ env.ORAS_PATH } push --plain-http ${ env.ORAS_REGISTRY_HOST }/hello-artifact:v2 --config config.json:application/vnd.acme.rocket.config.v1+json artifact.txt:text/plain -d -v
rm -f config.json artifact.txt
${ env.ORAS_PATH } pull --plain-http ${ env.ORAS_REGISTRY_HOST }/hello-artifact:v2 -d -v
grep -q "hello world" artifact.txt
rm -f artifact.txt
docker kill zot || true
env:
ORAS_PATH: bin/linux/amd64/oras
ORAS_REGISTRY_HOST: localhost:5000
- name: Check Version
run: bin/linux/amd64/oras version
43 changes: 43 additions & 0 deletions .github/workflows/zot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright The ORAS Authors.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: zot

on:
workflow_call:
push:
branches:
- main
- release-*
pull_request:
branches:
- main
- release-*
jobs:
setup:
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- name: Install dependencies
run: |
apt-get update && apt-get -y install skopeo curl
- name: Setup
run: |
mkdir /tmp/zot
skopeo copy --format=oci docker://busybox:latest oci:/tmp/zot/busybox:latest
docker run -d --name zot -v /tmp/zot:/var/lib/registry -p 5000:5000 ghcr.io/project-zot/zot-minimal-linux-amd64:latest
# wait until service is up
while true; do curl -f https://${ env.ORAS_REGISTRY_HOST }/v2/; if [ $? -eq 0 ]; then break; fi; sleep 1; done
env:
ORAS_REGISTRY_HOST: localhost:5000

0 comments on commit c554d34

Please sign in to comment.