-
Notifications
You must be signed in to change notification settings - Fork 31
148 lines (122 loc) · 4.16 KB
/
pull-request.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# Basic CI workflow for pull requests
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially
jobs:
guest_scripts:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
shell: bash
- os: ubuntu-latest
shell: dash
runs-on: ${{ matrix.os }}
timeout-minutes: 4
steps:
- name: Check out forklift repository
uses: actions/checkout@v4
- run: ${{ matrix.shell }} ./virt-v2v/pkg/customize/scripts/rhel/run/test-network_config_util.sh
ci_setup:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
source_provider: ovirt
- os: ubuntu-latest
source_provider: vsphere
- os: ubuntu-latest
source_provider: openstack
- os: ubuntu-latest
source_provider: ova
runs-on: ${{ matrix.os }}
env:
USE_BAZEL_VERSION: 5.4.0
timeout-minutes: 45
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
swap-storage: false
docker-images: false
- name: Check out forklift repository
uses: actions/checkout@v4
- name: Checkout forkliftci
uses: actions/checkout@v4
with:
repository: kubev2v/forkliftci
ref: v16.0
- name: Build and setup everything with bazel
id: forkliftci
uses: kubev2v/forkliftci/ci/[email protected]
with:
provider_name: ${{ matrix.source_provider }}
gh_access_token: ${{ secrets.GITHUB_TOKEN }}
- run: kubectl version
- run: kubectl get pods -n konveyor-forklift
- name: Test call to Forklift
run: |
curl -k "${{ steps.forkliftci.outputs.cluster }}/apis/forklift.konveyor.io/v1beta1/namespaces/konveyor-forklift/providers" --header "Authorization: Bearer ${{ steps.forkliftci.outputs.token }}"
- name: Run e2e sanity suite
uses: kubev2v/forkliftci/ci/[email protected]
with:
suite_name: e2e-sanity-${{ matrix.source_provider }}
- name: save k8s logs and upload-artifact
if: ${{ always() }}
uses: kubev2v/forkliftci/ci/[email protected]
with:
source_provider: ${{ matrix.source_provider }}
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
USE_BAZEL_VERSION: 5.4.0
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checks-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v4
with:
path: go/src/github.com/${{github.repository}}
- name: Cache Go modules
uses: actions/cache@v3
with:
path: ${HOME}/go/pkg/mod
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}
- name: Setup Golang
uses: actions/setup-go@v4
with:
# NOTE: Keep the version in sync with Go toolchain in WORKSPACE.
go-version: '1.21.9'
# Setup the run environment and run CI test suite
- name: Run test suite
run: |
cd ${GITHUB_WORKSPACE}/go/src/github.com/${GITHUB_REPOSITORY}
GOPATH=${GITHUB_WORKSPACE}/go make ci
# Push code coverage using Codecov Action
- name: Push code coverage to Codecov
uses: codecov/codecov-action@v4
with:
working-directory: ./go/src/github.com/${{ github.repository }}
file: ./cover.out
flags: unittests
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}