diff --git a/.github/workflows/ecosystem.yml b/.github/workflows/ecosystem.yml new file mode 100644 index 000000000..03665dd17 --- /dev/null +++ b/.github/workflows/ecosystem.yml @@ -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 diff --git a/.github/workflows/zot.yml b/.github/workflows/zot.yml new file mode 100644 index 000000000..5bbf259ac --- /dev/null +++ b/.github/workflows/zot.yml @@ -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