github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/.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 # Run make presubmit_aux. 34 - name: run 35 env: 36 GITHUB_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} 37 GITHUB_PR_BASE_SHA: ${{ github.event.pull_request.base.sha }} 38 GITHUB_PR_COMMITS: ${{ github.event.pull_request.commits }} 39 run: | 40 cd gopath/src/github.com/google/syzkaller 41 .github/workflows/run.sh make presubmit_aux 42 43 build: 44 runs-on: arc-runner-set 45 container: gcr.io/syzkaller/env:latest 46 env: 47 GOPATH: /__w/syzkaller/syzkaller/gopath 48 CI: true 49 TERM: dumb 50 GITHUB_ACTIONS: true 51 steps: 52 - name: checkout 53 uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 54 with: 55 path: gopath/src/github.com/google/syzkaller 56 57 - id: get-date 58 run: echo "date=$(/bin/date -u "+%Y%m%d+%T")" >> $GITHUB_OUTPUT 59 shell: bash 60 - name: test build cache 61 uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 62 with: 63 path: /root/.cache 64 key: ${{ runner.os }}-go-test-build-${{ steps.get-date.outputs.date }} #always miss and upload fresh item 65 restore-keys: ${{ runner.os }}-go-test-build- #read the freshest available after miss 66 67 - name: run 68 run: | 69 cd gopath/src/github.com/google/syzkaller 70 .github/workflows/run.sh make presubmit_build 71 - name: codecov 72 uses: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be # v4.3.1 73 with: 74 codecov_yml_path: ${{env.GOPATH}}/src/github.com/google/syzkaller/.github/codecov.yml 75 file: ${{env.GOPATH}}/src/github.com/google/syzkaller/.coverage.txt 76 flags: unittests 77 token: ${{ secrets.CODECOV_TOKEN }} 78 verbose: true 79 80 dashboard: 81 runs-on: arc-runner-set 82 container: gcr.io/syzkaller/env:latest 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: run 94 run: | 95 cd gopath/src/github.com/google/syzkaller 96 .github/workflows/run.sh timeout --signal=SIGINT 15m make presubmit_dashboard 97 - name: codecov 98 uses: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be # v4.3.1 99 with: 100 codecov_yml_path: ${{env.GOPATH}}/src/github.com/google/syzkaller/.github/codecov.yml 101 file: ${{env.GOPATH}}/src/github.com/google/syzkaller/.coverage.txt 102 flags: dashboard 103 token: ${{ secrets.CODECOV_TOKEN }} 104 verbose: true 105 106 arch: 107 runs-on: ubuntu-latest 108 container: gcr.io/syzkaller/env:latest 109 env: 110 GOPATH: /__w/syzkaller/syzkaller/gopath 111 CI: true 112 TERM: dumb 113 strategy: 114 matrix: 115 target: [ presubmit_arch_linux, presubmit_arch_freebsd, presubmit_arch_netbsd, presubmit_arch_openbsd, presubmit_arch_darwin, presubmit_arch_windows, presubmit_arch_executor ] 116 steps: 117 - name: checkout 118 uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 119 with: 120 path: gopath/src/github.com/google/syzkaller 121 - name: run 122 run: | 123 cd gopath/src/github.com/google/syzkaller 124 .github/workflows/run.sh make ${{ matrix.target }} 125 126 race: 127 runs-on: arc-runner-set 128 timeout-minutes: 15 # Q1 2024 experiments may affect timeout, let's relax it 129 container: gcr.io/syzkaller/env:latest 130 env: 131 GOPATH: /__w/syzkaller/syzkaller/gopath 132 CI: true 133 TERM: dumb 134 steps: 135 - name: checkout 136 uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 137 with: 138 path: gopath/src/github.com/google/syzkaller 139 140 # https://github.com/golang/go/issues/61608 to cache -race results. 141 - id: get-date 142 run: echo "date=$(/bin/date -u "+%Y%m%d+%T")" >> $GITHUB_OUTPUT 143 shell: bash 144 - name: test race cache 145 uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 146 with: 147 path: /root/.cache 148 key: ${{ runner.os }}-go-test-race-${{ steps.get-date.outputs.date }} #always miss and upload fresh item 149 restore-keys: ${{ runner.os }}-go-test-race- #read the freshest available after miss 150 151 - name: run 152 run: | 153 cd gopath/src/github.com/google/syzkaller 154 .github/workflows/run.sh make presubmit_race 155 156 race_dashboard: 157 runs-on: arc-runner-set 158 container: gcr.io/syzkaller/env:latest 159 env: 160 GOPATH: /__w/syzkaller/syzkaller/gopath 161 CI: true 162 TERM: dumb 163 steps: 164 - name: checkout 165 uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 166 with: 167 path: gopath/src/github.com/google/syzkaller 168 - name: run 169 run: | 170 cd gopath/src/github.com/google/syzkaller 171 .github/workflows/run.sh make presubmit_race_dashboard 172 173 old: 174 runs-on: ubuntu-latest 175 container: gcr.io/syzkaller/old-env:latest 176 env: 177 GOPATH: /__w/syzkaller/syzkaller/gopath 178 CI: true 179 TERM: dumb 180 steps: 181 - name: checkout 182 uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 183 with: 184 path: gopath/src/github.com/google/syzkaller 185 - name: run 186 run: | 187 cd gopath/src/github.com/google/syzkaller 188 .github/workflows/run.sh make presubmit_old