-
Notifications
You must be signed in to change notification settings - Fork 8
85 lines (74 loc) · 2.46 KB
/
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
77
78
79
80
81
82
83
84
85
name: Test Tekton-Cache on CRC
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Run E2E Tests on CRC
runs-on: ubuntu-latest
if: github.repository_owner == 'openshift-pipelines' # do not run this elsewhere
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: ko-build/[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/rest/mirror/pub/openshift-v4/clients/crc/latest/crc-linux-amd64.tar.xz"
latest_version=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' https://github.com/crc-org/crc \
| tail -n1 \
| sed 's/.*\///; s/\^{}//; s/^v//')
# Use the extracted version in the tar command
tar -xf crc-linux-amd64.tar.xz --directory /usr/local/bin --strip-components=1 "crc-linux-${latest_version}-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
run: |
chmod +x tests/crc_test.sh
./tests/crc_test.sh