Bootstrap crc in github action #6
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: Test Chains on CRC | |
on: | |
# only check PRs for new issues until preexisting issues are cleaned | |
pull_request: | |
branches: | |
- main | |
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: crc start --pull-secret-file pull-secret | |
- 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 |