forked from dfinity/ic
-
Notifications
You must be signed in to change notification settings - Fork 0
168 lines (167 loc) · 5.59 KB
/
ci-pr-only.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: CI PR Only
# Jobs that run on PRs, but no other pipelines
on:
pull_request:
types: [opened, synchronize, reopened]
permissions: read-all
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
env:
CI_MERGE_REQUEST_TITLE: ${{ github.event.pull_request.title }}
CI_PROJECT_DIR: ${{ github.workspace }}
ORG: ${{ github.repository_owner }}
jobs:
bazel-build-fuzzers-archives:
name: Bazel Build Fuzzers Archives
runs-on:
labels: dind-runner-large
container:
image: ghcr.io/dfinity/ic-build@sha256:eb85228ebf7511e2589f86788345eb3d1c8144914a8a2fa771d4347ddacac413
timeout-minutes: 60
if: ${{ vars.RUN_CI == 'true' }}
steps:
- name: Before script
if: always()
id: before-script
shell: bash
run: |
git config --global http.postBuffer 524288000
git config --global safe.directory '*'
if [ -e /__w/cache ]; then sudo ln -s /__w/cache /; fi
if [ -n "${NODE_NAME:-}" ]; then echo "Node: $NODE_NAME"; fi
- name: Checkout
uses: actions/checkout@v4
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
name: Filter Relevant Files
id: filter
with:
filters: |
fuzzers:
- '.github/workflows/pr-only.yml'
- 'bin/build-all-fuzzers.sh'
- 'bazel/fuzz_testing.bzl'
- name: Run Bazel Build Fuzzers Archives
id: bazel-build-fuzzers-archives
if: steps.filter.outputs.fuzzers == 'true'
shell: bash
run: |
set -euo pipefail
cd "${GITHUB_WORKSPACE}"/bin
./build-all-fuzzers.sh --zip
- name: No run
if: steps.filter.outputs.fuzzers == 'false'
run: echo "No changes in fuzzers, skipping build"
- name: Bazel Clean
if: always()
run: bazel clean
lock-generate:
name: Lock Generate
runs-on:
labels: dind-runner-small
container:
image: ghcr.io/dfinity/ic-build@sha256:eb85228ebf7511e2589f86788345eb3d1c8144914a8a2fa771d4347ddacac413
timeout-minutes: 30
if: ${{ vars.RUN_CI == 'true' }}
steps:
- name: Before script
if: always()
id: before-script
shell: bash
run: |
git config --global http.postBuffer 524288000
git config --global safe.directory '*'
if [ -e /__w/cache ]; then sudo ln -s /__w/cache /; fi
if [ -n "${NODE_NAME:-}" ]; then echo "Node: $NODE_NAME"; fi
- name: Checkout
uses: actions/checkout@v4
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
name: Filter Relevant Files
id: filter
with:
filters: |
lock-generate:
- '.github/workflows/pr-only.yml'
- '.bazelrc'
- '.bazelversion'
- '**/*.bazel'
- '**/*.bzl'
- '**/*.lock'
- '**/*.rs'
- '**/*.toml'
- name: Run Lock Generate
id: lock-generate
if: steps.filter.outputs.lock-generate == 'true'
run: ./gitlab-ci/src/ci-scripts/lock-generate.sh
- name: No run
if: steps.filter.outputs.lock-generate == 'false'
run: echo "No changes in lock-generate, skipping run"
commit-lint:
name: Commit Lint
runs-on:
labels: default-runner
container:
image: ghcr.io/dfinity/ic-build@sha256:eb85228ebf7511e2589f86788345eb3d1c8144914a8a2fa771d4347ddacac413
timeout-minutes: 30
if: ${{ vars.RUN_CI == 'true' }}
steps:
- name: Before script
if: always()
id: before-script
shell: bash
run: |
git config --global http.postBuffer 524288000
git config --global safe.directory '*'
if [ -e /__w/cache ]; then sudo ln -s /__w/cache /; fi
if [ -n "${NODE_NAME:-}" ]; then echo "Node: $NODE_NAME"; fi
- name: Checkout
uses: actions/checkout@v4
- name: Commit Lint
id: commit-lint
run: ./gitlab-ci/src/ci-scripts/commit-lint.sh
pre-commit:
name: Pre Commit Test
runs-on:
labels: dind-runner-small
container:
image: ghcr.io/dfinity/ic-build@sha256:eb85228ebf7511e2589f86788345eb3d1c8144914a8a2fa771d4347ddacac413
timeout-minutes: 30
if: ${{ vars.RUN_CI == 'true' }}
steps:
- name: Before script
if: always()
id: before-script
shell: bash
run: |
git config --global http.postBuffer 524288000
git config --global safe.directory '*'
if [ -e /__w/cache ]; then sudo ln -s /__w/cache /; fi
if [ -n "${NODE_NAME:-}" ]; then echo "Node: $NODE_NAME"; fi
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 256
- name: Pre-Commit
id: pre-commit
shell: bash
run: ./gitlab-ci/src/ci-scripts/pre-commit.sh
# Todo: remove when migration complete
change-base-branch:
name: Change Base Branch
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Run script
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python $CI_PROJECT_DIR/.github/scripts/change-base-branch.py
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.IDX_PUSH_TO_PR }}