ci: fix conformance and e2e workflows

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2021-12-20 16:39:09 +01:00
parent 4941d83cc7
commit 6332e9631e
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
2 changed files with 28 additions and 32 deletions

View file

@ -8,27 +8,26 @@ jobs:
run-conformance-test:
runs-on: ubuntu-latest
steps:
- name: set up docker
uses: docker-practice/actions-setup-docker@0.0.1
-
name: Checkout
uses: actions/checkout@v2
with:
docker_version: 18.09
docker_channel: stable
- uses: actions/checkout@v2
fetch-depth: 0
-
name: Build image
uses: docker/bake-action@v1
with:
path: src/github.com/distribution/distribution
- name: start distribution server
working-directory: ./src/github.com/distribution/distribution
targets: image-local
-
name: Start distribution server
run: |
IP=`hostname -I | awk '{print $1}'`
echo "IP=$IP" >> $GITHUB_ENV
echo "OCI_ROOT_URL=http://$IP:5000" >> $GITHUB_ENV
DISTRIBUTION_REF="local-distribution:v$(date +%Y%m%d%H%M%S)"
docker build -f ./Dockerfile -t "${DISTRIBUTION_REF}" .
docker run --rm -p 5000:5000 -e REGISTRY_STORAGE_DELETE_ENABLED=true -idt "${DISTRIBUTION_REF}"
- name: Run OCI Distribution Spec conformance tests
DISTRIBUTION_REF="registry:local"
docker run --rm -p 5000:5000 -e REGISTRY_STORAGE_DELETE_ENABLED=true -idt "registry:local"
-
name: Run OCI Distribution Spec conformance tests
uses: opencontainers/distribution-spec@main
env:
OCI_ROOT_URL: ${{ env.OCI_ROOT_URL }}

View file

@ -12,28 +12,25 @@ jobs:
run-e2e-test:
runs-on: ubuntu-latest
steps:
- name: set up docker
uses: docker-practice/actions-setup-docker@0.0.1
-
name: Checkout
uses: actions/checkout@v2
with:
docker_version: 18.09
docker_channel: stable
- name: checkout distribution
uses: actions/checkout@master
fetch-depth: 0
-
name: Build image
uses: docker/bake-action@v1
with:
path: main
- name: start distribution server
targets: image-local
-
name: Start distribution server
run: |
IP=`hostname -I | awk '{print $1}'`
echo "IP=$IP" >> $GITHUB_ENV
echo '{"insecure-registries" : ["'$IP':5000"]}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
DISTRIBUTION_REF="local-distribution:v$(date +%Y%m%d%H%M%S)"
cd ./main
docker build -f ./Dockerfile -t "${DISTRIBUTION_REF}" .
docker run --rm -p 5000:5000 -p 5001:5001 -idt "${DISTRIBUTION_REF}"
- name: script
docker run --rm -p 5000:5000 -p 5001:5001 -idt "registry:local"
-
name: Tests
run: |
bash ./main/tests/push.sh $IP
bash ./tests/push.sh $IP