forked from cubefs/cubefs
-
Notifications
You must be signed in to change notification settings - Fork 2
113 lines (96 loc) · 3.1 KB
/
ci.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
# 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
- develop-*
- blobstore-*
paths-ignore:
# - 'blobstore/**'
# - '.github/**'
# - 'docs/**'
# - 'docs-zh/**'
# - '**.md'
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
id: changed-files
uses: tj-actions/changed-files@87697c0dca7dd44e37a2b79a79489332556ff1f3 # v37.6.0
with:
files: |
.github/**
docs/**
docs-zh/**
**.md
- name: Check gofmt
if: steps.changed-files.outputs.only_changed != 'true'
run: |
docker/run_docker.sh --format
- name: Unit tests
if: steps.changed-files.outputs.only_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@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
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