2021-01-27 20:29:24 -05:00
|
|
|
# This is a conformance test workflow that is automatically triggered with each PR
|
|
|
|
|
|
|
|
name: conformance
|
|
|
|
|
|
|
|
# Controls when the action will run. Workflow runs when manually triggered using the UI
|
|
|
|
# or API.
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-10-21 13:13:14 -05:00
|
|
|
- main
|
2021-01-27 20:29:24 -05:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2021-10-21 13:13:14 -05:00
|
|
|
- main
|
2021-01-27 20:29:24 -05:00
|
|
|
|
2022-07-16 18:22:38 -05:00
|
|
|
permissions: read-all
|
|
|
|
|
2021-01-27 20:29:24 -05:00
|
|
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
|
|
jobs:
|
|
|
|
run:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
|
|
steps:
|
2023-04-27 02:09:46 -05:00
|
|
|
- name: Install go 1.20
|
2023-03-22 14:33:21 -05:00
|
|
|
uses: actions/setup-go@v4
|
2021-01-27 20:29:24 -05:00
|
|
|
with:
|
2023-03-22 14:33:21 -05:00
|
|
|
cache: false
|
2023-04-27 02:09:46 -05:00
|
|
|
go-version: 1.20.x
|
2022-04-07 06:48:54 -05:00
|
|
|
- name: Checkout this PR
|
2022-07-13 16:15:33 -05:00
|
|
|
uses: actions/checkout@v3
|
2022-04-07 06:48:54 -05:00
|
|
|
- name: Start zot server
|
2021-01-27 20:29:24 -05:00
|
|
|
run: |
|
2022-04-07 06:48:54 -05:00
|
|
|
cd $GITHUB_WORKSPACE
|
|
|
|
make binary
|
|
|
|
RUNNER_TRACKING_ID="" && ./bin/zot-linux-amd64 serve examples/config-conformance.json &
|
2021-01-27 20:29:24 -05:00
|
|
|
IP=`hostname -I | awk '{print $1}'`
|
2022-04-07 06:48:54 -05:00
|
|
|
echo "SERVER_URL=http://${IP}:8080" >> $GITHUB_ENV
|
2023-07-10 04:24:45 -05:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
# TODO: change to upstream once the foloowing PR is merged:
|
|
|
|
# https://github.com/opencontainers/distribution-spec/pull/436
|
2023-08-04 15:38:28 -05:00
|
|
|
repository: opencontainers/distribution-spec
|
|
|
|
ref: main
|
2023-07-10 04:24:45 -05:00
|
|
|
path: distribution-spec
|
|
|
|
- name: build conformance binary from main
|
|
|
|
run: |
|
|
|
|
(cd distribution-spec/ && make conformance-binary)
|
|
|
|
mv distribution-spec/output/conformance.test .
|
|
|
|
rm -rf distribution-spec/
|
|
|
|
- name: run conformance
|
2021-01-27 20:29:24 -05:00
|
|
|
env:
|
2021-10-15 10:05:00 -05:00
|
|
|
OCI_ROOT_URL: ${{ env.SERVER_URL }}
|
2021-01-27 20:29:24 -05:00
|
|
|
OCI_NAMESPACE: oci-conformance/distribution-test
|
|
|
|
OCI_TEST_PULL: 1
|
|
|
|
OCI_TEST_PUSH: 1
|
|
|
|
OCI_TEST_CONTENT_DISCOVERY: 1
|
2023-06-24 20:51:47 -05:00
|
|
|
OCI_TEST_CONTENT_MANAGEMENT: 1
|
|
|
|
OCI_REFERRERS: 1
|
2023-07-10 04:24:45 -05:00
|
|
|
OCI_CROSSMOUNT_NAMESPACE: oci-conformance/crossmount-test
|
|
|
|
run: |
|
|
|
|
./conformance.test
|
2021-01-27 20:29:24 -05:00
|
|
|
- run: mkdir -p .out/ && mv {report.html,junit.xml} .out/
|
|
|
|
if: always()
|
|
|
|
- name: Upload test results zip as build artifact
|
2022-07-18 12:23:05 -05:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-01-27 20:29:24 -05:00
|
|
|
with:
|
|
|
|
name: oci-test-results-${{ github.sha }}
|
|
|
|
path: .out/
|
2023-07-10 04:24:45 -05:00
|
|
|
if: github.event_name == 'push'
|