-
Notifications
You must be signed in to change notification settings - Fork 34
61 lines (61 loc) · 2 KB
/
main.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
on: ["pull_request"]
name: Static checks
jobs:
test:
runs-on: ubuntu-20.04
env:
GO111MODULE: off
TRAVIS: "true"
TRAVIS_BRANCH: ${{ github.base_ref }}
TRAVIS_PULL_REQUEST_BRANCH: ${{ github.head_ref }}
TRAVIS_PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: "1.16"
- name: Setup GOPATH
run: |
echo "TRAVIS_BRANCH: ${TRAVIS_BRANCH}"
echo "TRAVIS_PULL_REQUEST_BRANCH: ${TRAVIS_PULL_REQUEST_BRANCH}"
echo "TRAVIS_PULL_REQUEST_SHA: ${TRAVIS_PULL_REQUEST_SHA}"
echo "TRAVIS: ${TRAVIS}"
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
path: ${{ github.workspace }}/src/github.com/kata-containers/ci
- name: Set env
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: Setup travis references
run: |
echo "TRAVIS_BRANCH=${TRAVIS_BRANCH:-$(echo $GITHUB_REF | awk 'BEGIN { FS = \"/\" } ; { print $3 }')}"
- name: Setup
run: |
ci_repo=$(go env GOPATH)/src/github.com/kata-containers/ci
pushd ${ci_repo}
GOPATH=$(go env GOPATH) .ci/setup.sh
- name: Running static checks
run: |
ci_repo=$(go env GOPATH)/src/github.com/kata-containers/ci
pushd ${ci_repo}
GOPATH=$(go env GOPATH) .ci/static-checks.sh
# Check that all jobs can be generated.
jobs-builder-check:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install the Jenkins Job Builder
run: |
pip install --user --upgrade jinja2
pip install --user jenkins-job-builder==4.3.0
- name: Check it can generate all jobs
run: |
cd jobs-builder
cp jjb.conf.template jjb.conf
./publish_jobs.sh -c jjb.conf -t