Skip to content

Commit

Permalink
ci: fix conformance and e2e workflows
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Jan 11, 2022
1 parent 4941d83 commit 6332e96
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 32 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,26 @@ jobs:
run-conformance-test:
runs-on: ubuntu-latest
steps:
- name: set up docker
uses: docker-practice/[email protected]
-
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 }}
Expand Down
31 changes: 14 additions & 17 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,25 @@ jobs:
run-e2e-test:
runs-on: ubuntu-latest
steps:
- name: set up docker
uses: docker-practice/[email protected]
-
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

0 comments on commit 6332e96

Please sign in to comment.