Support SONiC #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Integration Test | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
test: | |
name: Run tests | |
runs-on: self-hosted | |
steps: | |
- name: Gain back workspace permissions # https://github.com/actions/checkout/issues/211 | |
run: | | |
[ -d "${GITHUB_WORKSPACE}" ] && sudo chown -R $USER:$USER ${GITHUB_WORKSPACE} | |
- name: Log in to the container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ secrets.DOCKER_REGISTRY_USER }} | |
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Make tag | |
run: | | |
[ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo "MINI_LAB_VM_IMAGE=ghcr.io/metal-stack/mini-lab-vms:${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV || true | |
[ "${GITHUB_EVENT_NAME}" == 'push' ] && echo "MINI_LAB_VM_IMAGE=ghcr.io/metal-stack/mini-lab-vms:latest" >> $GITHUB_ENV || true | |
- name: Build Docker image | |
run: | | |
make build-vms-image | |
docker push ${MINI_LAB_VM_IMAGE} | |
- name: Run integration tests | |
shell: bash | |
run: | | |
./test/ci-cleanup.sh | |
./test/integration.sh | |
env: | |
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} | |
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} |