forked from cubefs/cubefs
-
Notifications
You must be signed in to change notification settings - Fork 1
139 lines (118 loc) · 4.12 KB
/
ci.yml
File metadata and controls
139 lines (118 loc) · 4.12 KB
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
# This is a basic workflow to help you get started with Actions
name: CI
on:
push:
branches: [ master ]
paths-ignore:
- '.github/**'
- 'docs/**'
- 'docs-zh/**'
- '**.md'
pull_request:
branches:
- master
- release-*
- develop-*
- blobstore-*
# paths-ignore:
# - 'blobstore/**'
permissions:
contents: read
jobs:
ci-test-unit:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Find changed files of document
id: changed-files
uses: tj-actions/changed-files@87697c0dca7dd44e37a2b79a79489332556ff1f3 # v37.6.0
with:
files: |
.github/**
docs/**
docs-zh/**
**.md
- name: Find changed files of blobstore
id: changed-blobs
uses: tj-actions/changed-files@87697c0dca7dd44e37a2b79a79489332556ff1f3 # v37.6.0
with:
files: |
blobstore/**
- name: All changed documents
if: steps.changed-files.outputs.only_changed == 'true'
env:
CI_ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
for file in ${CI_ALL_CHANGED_FILES}; do
echo "<$file> was changed"
done
- name: Check gofmt
if: steps.changed-files.outputs.only_changed != 'true'
run: |
docker/run_docker.sh --format
- name: Unit test for blobstore
if: steps.changed-blobs.outputs.only_changed == 'true'
run: |
docker/run_docker.sh --testblobstore
- name: Unit test for cubefs
if: ${{ (steps.changed-files.outputs.only_changed != 'true') &&
(steps.changed-blobs.outputs.any_changed != 'true') }}
run: |
docker/run_docker.sh --testcubefs
- name: Unit test for all
if: ${{ (steps.changed-files.outputs.only_changed != 'true') &&
(steps.changed-blobs.outputs.only_changed != 'true') &&
(steps.changed-blobs.outputs.any_changed == 'true') }}
run: |
docker/run_docker.sh --test
- name: Upload codecov
if: steps.changed-files.outputs.only_changed != 'true'
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
with:
files: ./coverage.txt
ci-test-s3:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Find changed files
id: changed-files
uses: tj-actions/changed-files@87697c0dca7dd44e37a2b79a79489332556ff1f3 # v37.6.0
with:
files: |
.github/**
docs/**
docs-zh/**
**.md
- name: Remove pre-installed software to free up disk space
if: steps.changed-files.outputs.only_changed != 'true'
run: |
sudo rm -rf /usr/local/lib/android
- name: S3 tests
if: steps.changed-files.outputs.only_changed != 'true'
run: |
docker/run_docker.sh --s3test
- name: Pack docker_data
if: ${{ always() && steps.changed-files.outputs.only_changed != 'true' }}
run: |
pushd docker
sudo tar --exclude='docker_data/datanode*/disk' --exclude='docker_data/disk' -czvf docker_data.tar.gz docker_data
popd
- name: Upload docker_data.tar.gz
if: ${{ always() && steps.changed-files.outputs.only_changed != 'true' }}
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: docker_data
path: docker/docker_data.tar.gz
retention-days: 7
ci-sast:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Run Semgrep Security Scanner
uses: returntocorp/semgrep-action@fcd5ab7459e8d91cb1777481980d1b18b4fc6735 # v1
- name: Run Gosec Security Scanner
run: |
docker/run_docker.sh --gosec