-
Notifications
You must be signed in to change notification settings - Fork 12
43 lines (36 loc) · 1.21 KB
/
pr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Integration tests for PR
on:
pull_request:
branches:
- master
jobs:
test:
name: Integration tests for PR
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: Checkout
uses: actions/checkout@v3
- name: Docker Login
uses: docker/login-action@v2
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
- name: Set image name
run: echo "MINI_LAB_VM_IMAGE=ghcr.io/metal-stack/mini-lab-vms:pr-${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV
- name: Build Docker image
run: |
make build-vms-image
docker push ${MINI_LAB_VM_IMAGE}
- name: Run integration tests
shell: bash
run: |
export MINI_LAB_VM_IMAGE=ghcr.io/metal-stack/mini-lab-vms:pr-${GITHUB_HEAD_REF##*/}
./test/ci-cleanup.sh
./test/integration.sh
env:
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}