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:
|
2023-08-23 11:21:43 -05:00
|
|
|
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:
|
2024-02-07 13:54:28 -05:00
|
|
|
- name: Install go 1.21
|
2023-12-12 05:44:28 -05:00
|
|
|
uses: actions/setup-go@v5
|
2021-01-27 20:29:24 -05:00
|
|
|
with:
|
2023-03-22 14:33:21 -05:00
|
|
|
cache: false
|
2024-02-07 13:54:28 -05:00
|
|
|
go-version: 1.21.x
|
2023-08-23 11:21:43 -05:00
|
|
|
- name: Checkout this PR
|
2023-09-05 14:30:49 -05:00
|
|
|
uses: actions/checkout@v4
|
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-09-05 14:30:49 -05:00
|
|
|
- uses: actions/checkout@v4
|
2023-07-10 04:24:45 -05:00
|
|
|
with:
|
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: |
|
2023-08-23 11:21:43 -05:00
|
|
|
./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
|
2024-01-29 18:30:41 -05:00
|
|
|
uses: actions/upload-artifact@v4
|
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'
|