2021-01-27 17:29:24 -08: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:
|
2023-08-23 19:21:43 +03:00
|
|
|
branches:
|
2021-10-21 18:13:14 +00:00
|
|
|
- main
|
2021-01-27 17:29:24 -08:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2021-10-21 18:13:14 +00:00
|
|
|
- main
|
2021-01-27 17:29:24 -08:00
|
|
|
|
2022-07-16 23:22:38 +00:00
|
|
|
permissions: read-all
|
|
|
|
|
2021-01-27 17:29:24 -08: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:
|
2024-03-20 20:53:11 +02:00
|
|
|
- name: Install go 1.22
|
2023-12-12 02:44:28 -08:00
|
|
|
uses: actions/setup-go@v5
|
2021-01-27 17:29:24 -08:00
|
|
|
with:
|
2023-03-22 12:33:21 -07:00
|
|
|
cache: false
|
2024-03-20 20:53:11 +02:00
|
|
|
go-version: 1.22.x
|
2023-08-23 19:21:43 +03:00
|
|
|
- name: Checkout this PR
|
2023-09-05 12:30:49 -07:00
|
|
|
uses: actions/checkout@v4
|
2022-04-07 14:48:54 +03:00
|
|
|
- name: Start zot server
|
2021-01-27 17:29:24 -08:00
|
|
|
run: |
|
2022-04-07 14:48:54 +03:00
|
|
|
cd $GITHUB_WORKSPACE
|
|
|
|
make binary
|
|
|
|
RUNNER_TRACKING_ID="" && ./bin/zot-linux-amd64 serve examples/config-conformance.json &
|
2021-01-27 17:29:24 -08:00
|
|
|
IP=`hostname -I | awk '{print $1}'`
|
2022-04-07 14:48:54 +03:00
|
|
|
echo "SERVER_URL=http://${IP}:8080" >> $GITHUB_ENV
|
2023-09-05 12:30:49 -07:00
|
|
|
- uses: actions/checkout@v4
|
2023-07-10 12:24:45 +03:00
|
|
|
with:
|
2023-08-04 13:38:28 -07:00
|
|
|
repository: opencontainers/distribution-spec
|
|
|
|
ref: main
|
2023-07-10 12:24:45 +03: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 17:29:24 -08:00
|
|
|
env:
|
2021-10-15 18:05:00 +03:00
|
|
|
OCI_ROOT_URL: ${{ env.SERVER_URL }}
|
2021-01-27 17:29:24 -08:00
|
|
|
OCI_NAMESPACE: oci-conformance/distribution-test
|
|
|
|
OCI_TEST_PULL: 1
|
|
|
|
OCI_TEST_PUSH: 1
|
|
|
|
OCI_TEST_CONTENT_DISCOVERY: 1
|
2023-06-24 18:51:47 -07:00
|
|
|
OCI_TEST_CONTENT_MANAGEMENT: 1
|
|
|
|
OCI_REFERRERS: 1
|
2023-07-10 12:24:45 +03:00
|
|
|
OCI_CROSSMOUNT_NAMESPACE: oci-conformance/crossmount-test
|
|
|
|
run: |
|
2023-08-23 19:21:43 +03:00
|
|
|
./conformance.test
|
2021-01-27 17:29:24 -08:00
|
|
|
- run: mkdir -p .out/ && mv {report.html,junit.xml} .out/
|
|
|
|
if: always()
|
|
|
|
- name: Upload test results zip as build artifact
|
2024-01-29 15:30:41 -08:00
|
|
|
uses: actions/upload-artifact@v4
|
2021-01-27 17:29:24 -08:00
|
|
|
with:
|
|
|
|
name: oci-test-results-${{ github.sha }}
|
|
|
|
path: .out/
|
2023-07-10 12:24:45 +03:00
|
|
|
if: github.event_name == 'push'
|