-
Notifications
You must be signed in to change notification settings - Fork 135
76 lines (69 loc) · 2.21 KB
/
test-on-crc.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
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
72
73
74
75
76
name: Test Chains on CRC
on:
push:
branches:
- main
jobs:
build:
name: Run E2E Tests on CRC
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go:
- '1.22'
env:
SHELL: /bin/bash
KUBECONFIG: '/Users/runner/.kube/config'
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- uses: imjasonh/[email protected]
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Download and install CRC
run: |
wget "https://developers.redhat.com/content-gateway/file/pub/openshift-v4/clients/crc/2.40.0/crc-linux-amd64.tar.xz"
tar -xf crc-linux-amd64.tar.xz --directory /usr/local/bin --strip-components=1 crc-linux-2.40.0-amd64/crc
- name: Testing CRC
run: |
which crc
crc --help
- name: Install required virtualization software
run: |
sudo apt-get update
sudo apt install qemu-kvm libvirt-daemon libvirt-daemon-system
sudo usermod -a -G libvirt $USER
- name: Install yq
run: |
sudo wget https://github.com/mikefarah/yq/releases/download/v4.31.2/yq_linux_amd64 -O /usr/local/bin/yq
sudo chmod +x /usr/local/bin/yq
yq --version
- name: Set the crc config
env:
PULL_SECRET_CONTENT: ${{ secrets.CRC_TOKEN }}
run: |
crc config set preset microshift
echo "$PULL_SECRET_CONTENT" > pull-secret
crc config set pull-secret-file pull-secret
crc config set network-mode user
crc config set memory 14000
- name: Setup the crc
run: sudo -su $USER crc setup
- name: Start the crc
run: sudo -su $USER crc start
- name: Set Creds
run: |
sudo -su $USER crc oc-env
echo "KUBECONFIG=$HOME/.crc/machines/crc/kubeconfig" >> $GITHUB_ENV
- name: Install Tekton Pipelines and Chains
run: |
# To deploy on Openshift
oc adm policy add-scc-to-user anyuid -z tekton-pipelines-controller
oc adm policy add-scc-to-user anyuid -z tekton-pipelines-webhook
chmod +x test/crc_test.sh
./test/crc_test.sh