github.com/google/syzkaller@v0.0.0-20251211124644-a066d2bc4b02/.github/workflows/ci.yml (about) 1 # Copyright 2020 syzkaller project authors. All rights reserved. 2 # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. 3 4 # GitHub workflow reference: 5 # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions 6 7 name: ci 8 on: [push, pull_request] 9 permissions: 10 contents: read 11 12 # https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre 13 concurrency: 14 group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} 15 cancel-in-progress: true 16 17 jobs: 18 aux: 19 runs-on: ubuntu-latest 20 container: gcr.io/syzkaller/env:latest 21 env: 22 GOPATH: /__w/syzkaller/syzkaller/gopath 23 CI: true 24 TERM: dumb 25 steps: 26 # Checks out syzkaller repo at the path. 27 - name: checkout 28 uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 29 with: 30 path: gopath/src/github.com/google/syzkaller 31 # This is needed for tools/check-commits.sh 32 fetch-depth: 100 33 - id: get-date 34 run: echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT 35 shell: bash 36 - name: update cache 37 uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 38 with: 39 path: /syzkaller/.cache 40 key: ${{ runner.os }}-syzenv-${{ steps.get-date.outputs.date }} 41 # Run make presubmit_aux. 42 - name: run 43 env: 44 GITHUB_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} 45 GITHUB_PR_BASE_SHA: ${{ github.event.pull_request.base.sha }} 46 GITHUB_PR_COMMITS: ${{ github.event.pull_request.commits }} 47 run: | 48 cd gopath/src/github.com/google/syzkaller 49 .github/workflows/run.sh make presubmit_aux 50 51 build: 52 runs-on: syz-env-x86 53 env: 54 GOPATH: /__w/syzkaller/syzkaller/gopath 55 CI: true 56 TERM: dumb 57 GITHUB_ACTIONS: true 58 steps: 59 - name: checkout 60 uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 61 with: 62 path: gopath/src/github.com/google/syzkaller 63 - name: restore cache 64 uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 65 with: 66 path: /syzkaller/.cache 67 key: ${{ runner.os }}-syzenv- 68 - name: run 69 run: | 70 cd gopath/src/github.com/google/syzkaller 71 .github/workflows/run.sh make presubmit_build 72 - name: codecov 73 uses: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be # v4.3.1 74 with: 75 codecov_yml_path: ${{env.GOPATH}}/src/github.com/google/syzkaller/.github/codecov.yml 76 file: ${{env.GOPATH}}/src/github.com/google/syzkaller/.coverage.txt 77 flags: unittests 78 token: ${{ secrets.CODECOV_TOKEN }} 79 verbose: true 80 81 dashboard: 82 runs-on: syz-env-x86 83 env: 84 GOPATH: /__w/syzkaller/syzkaller/gopath 85 CI: true 86 TERM: dumb 87 GITHUB_ACTIONS: true 88 steps: 89 - name: checkout 90 uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 91 with: 92 path: gopath/src/github.com/google/syzkaller 93 - name: restore cache 94 uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 95 with: 96 path: /syzkaller/.cache 97 key: ${{ runner.os }}-syzenv- 98 - name: run 99 run: | 100 cd gopath/src/github.com/google/syzkaller 101 .github/workflows/run.sh timeout --signal=SIGINT 15m make presubmit_dashboard 102 - name: codecov 103 uses: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be # v4.3.1 104 with: 105 codecov_yml_path: ${{env.GOPATH}}/src/github.com/google/syzkaller/.github/codecov.yml 106 file: ${{env.GOPATH}}/src/github.com/google/syzkaller/.coverage.txt 107 flags: dashboard 108 token: ${{ secrets.CODECOV_TOKEN }} 109 verbose: true 110 111 arch: 112 runs-on: ubuntu-latest 113 container: gcr.io/syzkaller/env:latest 114 env: 115 GOPATH: /__w/syzkaller/syzkaller/gopath 116 CI: true 117 TERM: dumb 118 strategy: 119 matrix: 120 target: [ presubmit_arch_linux, presubmit_arch_freebsd, presubmit_arch_netbsd, presubmit_arch_openbsd, presubmit_arch_darwin, presubmit_arch_windows, presubmit_arch_executor ] 121 steps: 122 - name: checkout 123 uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 124 with: 125 path: gopath/src/github.com/google/syzkaller 126 - name: restore cache 127 uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 128 with: 129 path: /syzkaller/.cache 130 key: ${{ runner.os }}-syzenv- 131 - name: run 132 run: | 133 cd gopath/src/github.com/google/syzkaller 134 .github/workflows/run.sh make ${{ matrix.target }} 135 136 race: 137 runs-on: syz-env-x86 138 timeout-minutes: 15 # Q1 2024 experiments may affect timeout, let's relax it 139 env: 140 GOPATH: /__w/syzkaller/syzkaller/gopath 141 CI: true 142 TERM: dumb 143 steps: 144 - name: checkout 145 uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 146 with: 147 path: gopath/src/github.com/google/syzkaller 148 149 # https://github.com/golang/go/issues/61608 to cache -race results. 150 - name: restore cache 151 uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 152 with: 153 path: /syzkaller/.cache 154 key: ${{ runner.os }}-syzenv- 155 156 - name: run 157 run: | 158 cd gopath/src/github.com/google/syzkaller 159 .github/workflows/run.sh make presubmit_race 160 161 race_dashboard: 162 runs-on: syz-env-x86 163 env: 164 GOPATH: /__w/syzkaller/syzkaller/gopath 165 CI: true 166 TERM: dumb 167 steps: 168 - name: checkout 169 uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 170 with: 171 path: gopath/src/github.com/google/syzkaller 172 - name: restore cache 173 uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 174 with: 175 path: /syzkaller/.cache 176 key: ${{ runner.os }}-syzenv- 177 - name: run 178 run: | 179 cd gopath/src/github.com/google/syzkaller 180 .github/workflows/run.sh make presubmit_race_dashboard 181 182 old: 183 runs-on: ubuntu-latest 184 container: gcr.io/syzkaller/old-env:latest 185 env: 186 GOPATH: /__w/syzkaller/syzkaller/gopath 187 GOMODCACHE: /syzkaller/.cache/gomod 188 CI: true 189 TERM: dumb 190 steps: 191 - name: checkout 192 uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 193 with: 194 path: gopath/src/github.com/google/syzkaller 195 - name: restore cache 196 uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 197 with: 198 path: /syzkaller/.cache 199 key: ${{ runner.os }}-syzenv- 200 - name: run 201 run: | 202 cd gopath/src/github.com/google/syzkaller 203 .github/workflows/run.sh make presubmit_old 204 gvisor: 205 runs-on: ubuntu-latest 206 container: 207 image: gcr.io/syzkaller/syzbot:latest 208 options: --privileged 209 env: 210 GOPATH: /__w/syzkaller/syzkaller/gopath 211 GOMODCACHE: /syzkaller/.cache/gomod 212 CI: true 213 TERM: dumb 214 GITHUB_ACTIONS: true 215 steps: 216 - name: checkout 217 uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 218 with: 219 path: gopath/src/github.com/google/syzkaller 220 - name: restore cache 221 uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 222 with: 223 path: /syzkaller/.cache 224 key: ${{ runner.os }}-syzenv- 225 - name: run 226 run: | 227 cd gopath/src/github.com/google/syzkaller 228 make 229 .github/workflows/run.sh bash -xe tools/gvisor-smoke-test.sh