-
Notifications
You must be signed in to change notification settings - Fork 29
71 lines (64 loc) · 2.13 KB
/
test-function-runner.yml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Precommit - Integration Tests - function-runner-images
on:
pull_request:
branches:
- '*'
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- 'PROJECT'
- 'LICENSE'
- 'mesh-worker-service/README.md'
- 'tools/README.md'
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: clean disk
run: |
sudo swapoff -a
sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo apt clean
docker rmi $(docker images -q) -f
df -h
# the runner machine has a disk /dev/sdb1 which mounted to /mnt, and it has more free disk than /dev/sda1.
# we can use it to save docker's data to avoid bookie error due to lack of disk.
- name: change docker data dir
run: |
sudo service docker stop
echo '{ "exec-opts": ["native.cgroupdriver=cgroupfs"], "cgroup-parent": "/actions_job", "data-root": "/mnt/docker" }' | sudo tee /etc/docker/daemon.json
sudo service docker start
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup ssh access to build runner VM
uses: ./.github/actions/ssh-access
with:
limit-access-to-actor: true
- name: Deploy k8s cluster env
uses: nick-invision/retry@v2
with:
timeout_minutes: 60
max_attempts: 3
retry_on: error
command: |
.ci/deploy_pulsar_cluster.sh .ci/clusters/values_runner_images.yaml
on_retry_command: |
.ci/cleanup.sh
- name: Build runner images
env:
DOCKER_REPO: localhost:5000
run: |
PULSAR_IMAGE_TAG=3.2.2.1 PULSAR_IMAGE=streamnative/sn-platform KIND_PUSH=false images/build.sh
- name: Verify function runner
run: |
.ci/verify_function_runner.sh
- name: Wait for ssh connection when build fails
uses: ./.github/actions/ssh-access
if: failure()
continue-on-error: true
with:
action: wait