-
Notifications
You must be signed in to change notification settings - Fork 30
49 lines (44 loc) · 1.5 KB
/
pr.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
name: pull request
on:
pull_request:
branches:
- master
- main
jobs:
build:
runs-on: ubuntu-latest
name: build
steps:
- name: set repo name
shell: bash
env:
QUAY_REGISTRY: ${{ secrets.QUAY_REGISTRY }}
run: |
DEFAULT_QUAY_REGISTRY=${{ github.repository_owner }}/$(basename $GITHUB_REPOSITORY)
echo "REPOSITORY_NAME=$(basename $GITHUB_REPOSITORY)" |tee -a $GITHUB_ENV
echo "QUAY_REGISTRY=${QUAY_REGISTRY:-DEFAULT_QUAY_REGISTRY}" |tee -a $GITHUB_ENV
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.14
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Download operator sdk
shell: bash
env:
RELEASE_VERSION: v1.9.0
run: |
curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk_linux_amd64
chmod +x operator-sdk_linux_amd64
mkdir ${HOME}/bin
mv operator-sdk_linux_amd64 ${HOME}/bin/operator-sdk
echo "${HOME}/bin" |tee -a $GITHUB_PATH
- name: build code
shell: bash
run: make VERSION=latest
- name: build bundle
shell: bash
run: make bundle IMG=quay.io/${QUAY_REGISTRY}:0.0.1 VERSION=0.0.1 DEFAULT_CHANNEL=alpha
- name: verify bundle
shell: bash
run: operator-sdk bundle validate ./bundle --select-optional name=operatorhub