You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/ci.yaml
+93-80Lines changed: 93 additions & 80 deletions
Original file line number
Diff line number
Diff line change
@@ -3,73 +3,73 @@ name: CI
3
3
# Triggers the workflow on push or pull request events but only for the main branch
4
4
on:
5
5
push:
6
-
branches: [main]
6
+
branches: [main]
7
7
pull_request:
8
-
branches: [main]
8
+
branches: [main]
9
9
10
10
jobs:
11
11
build-and-validate:
12
12
runs-on: ubuntu-latest
13
13
14
14
steps:
15
-
- uses: actions/checkout@v2
16
-
17
-
- name: Setup Go environment
18
-
uses: actions/setup-go@v2.1.3
19
-
with:
20
-
# The Go version to download (if necessary) and use. Supports semver spec and ranges.
21
-
go-version: 1.18
22
-
23
-
- name: Generate Go sources, CRDs and schemas
24
-
run: |
25
-
./docker-run.sh ./build.sh
26
-
if [[ ! -z $(git status -s) ]]
27
-
then
28
-
echo 'Command `./docker-run.sh ./build.sh` did introduce changes, which should not be the case if it had been run as part of the PR. Please run it locally and check in the results as part of your PR.'
29
-
git --no-pager diff
30
-
exit 1
31
-
fi
32
-
33
-
- name: Validate samples against schemas
34
-
run: ./docker-run.sh ./validate-samples.sh
35
-
36
-
- name: Run GO tests
37
-
run: go test -coverprofile cover.out -v ./...
38
-
39
-
- name: Upload coverage to Codecov
40
-
uses: codecov/codecov-action@v2.1.0
41
-
42
-
- name: Check typescript model generation
43
-
run: ./build/typescript-model/generate.sh
44
-
45
-
- name: Check GO mod state
46
-
run: |
47
-
go mod tidy
48
-
go mod vendor
49
-
git diff --exit-code || { echo 'Go mod is not clean. Execute "go mod tidy && go mod vendor" locally and commit changes to fix an issue'; exit 1; }
50
-
51
-
- name: Check GO format
52
-
run: |
53
-
go fmt -x ./...
54
-
git diff --exit-code || { echo 'Go sources need to be formated. Execute "go fmt -x ./..." locally and commit changes to fix an issue'; exit 1; }
55
-
56
-
- name: Check Generator GO mod state
57
-
working-directory: generator
58
-
run: |
59
-
go mod tidy
60
-
go mod vendor
61
-
git diff --exit-code || { echo 'Go mod is not clean. Execute "go mod tidy && go mod vendor" locally in the 'generator' folder and commit changes to fix an issue'; exit 1; }
62
-
63
-
- name: Check Generator GO format
64
-
working-directory: generator
65
-
run: |
66
-
go fmt -x ./...
67
-
git diff --exit-code || { echo 'Go sources need to be formated. Execute "go fmt -x ./..." locally in the 'generator' folder and commit changes to fix an issue'; exit 1; }
68
-
- name: Upload Json schemas
69
-
uses: actions/upload-artifact@v2
70
-
with:
71
-
name: devfile-json-schema
72
-
path: schemas/latest/devfile.json
15
+
- uses: actions/checkout@v2
16
+
17
+
- name: Setup Go environment
18
+
uses: actions/setup-go@v2.1.3
19
+
with:
20
+
# The Go version to download (if necessary) and use. Supports semver spec and ranges.
21
+
go-version: 1.18
22
+
23
+
- name: Generate Go sources, CRDs and schemas
24
+
run: |
25
+
./docker-run.sh ./build.sh
26
+
if [[ ! -z $(git status -s) ]]
27
+
then
28
+
echo 'Command `./docker-run.sh ./build.sh` did introduce changes, which should not be the case if it had been run as part of the PR. Please run it locally and check in the results as part of your PR.'
29
+
git --no-pager diff
30
+
exit 1
31
+
fi
32
+
33
+
- name: Validate samples against schemas
34
+
run: ./docker-run.sh ./validate-samples.sh
35
+
36
+
- name: Run GO tests
37
+
run: go test -coverprofile cover.out -v ./...
38
+
39
+
- name: Upload coverage to Codecov
40
+
uses: codecov/codecov-action@v2.1.0
41
+
42
+
- name: Check typescript model generation
43
+
run: ./build/typescript-model/generate.sh
44
+
45
+
- name: Check GO mod state
46
+
run: |
47
+
go mod tidy
48
+
go mod vendor
49
+
git diff --exit-code || { echo 'Go mod is not clean. Execute "go mod tidy && go mod vendor" locally and commit changes to fix an issue'; exit 1; }
50
+
51
+
- name: Check GO format
52
+
run: |
53
+
go fmt -x ./...
54
+
git diff --exit-code || { echo 'Go sources need to be formatted. Execute "go fmt -x ./..." locally and commit changes to fix an issue'; exit 1; }
55
+
56
+
- name: Check Generator GO mod state
57
+
working-directory: generator
58
+
run: |
59
+
go mod tidy
60
+
go mod vendor
61
+
git diff --exit-code || { echo 'Go mod is not clean. Execute "go mod tidy && go mod vendor" locally in the 'generator' folder and commit changes to fix an issue'; exit 1; }
62
+
63
+
- name: Check Generator GO format
64
+
working-directory: generator
65
+
run: |
66
+
go fmt -x ./...
67
+
git diff --exit-code || { echo 'Go sources need to be formatted. Execute "go fmt -x ./..." locally in the 'generator' folder and commit changes to fix an issue'; exit 1; }
0 commit comments