2020-11-24 16:12:39 +08:00
|
|
|
name: Code Checker
|
|
|
|
# TODO: do not trigger action for some document file update
|
|
|
|
|
|
|
|
# This workflow is triggered on pushes or pull request to the repository.
|
|
|
|
on:
|
2022-02-21 20:11:51 +08:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2020-11-24 16:12:39 +08:00
|
|
|
pull_request:
|
|
|
|
# file paths to consider in the event. Optional; defaults to all.
|
|
|
|
paths:
|
|
|
|
- 'scripts/**'
|
|
|
|
- 'internal/**'
|
2023-04-11 10:32:31 +08:00
|
|
|
- 'pkg/**'
|
2020-11-24 16:12:39 +08:00
|
|
|
- 'cmd/**'
|
|
|
|
- 'build/**'
|
2023-05-23 21:09:28 +08:00
|
|
|
- 'tests/integration/**'
|
2020-11-24 16:12:39 +08:00
|
|
|
- '.github/workflows/code-checker.yaml'
|
|
|
|
- '.env'
|
|
|
|
- docker-compose.yml
|
|
|
|
- Makefile
|
|
|
|
- '!**.md'
|
2021-05-14 18:23:30 +08:00
|
|
|
- '!build/ci/jenkins/**'
|
2021-09-29 23:28:55 +08:00
|
|
|
# FIXME(wxyu): not need to run code check, update the ci-passed rules and remove these two lines
|
|
|
|
- go.mod
|
|
|
|
- go.sum
|
2023-03-10 13:35:52 +08:00
|
|
|
- .golangci.yml
|
|
|
|
- rules.go
|
2020-11-24 16:12:39 +08:00
|
|
|
|
2023-12-14 11:30:38 +08:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
2024-01-09 18:28:48 +08:00
|
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
2023-12-14 11:30:38 +08:00
|
|
|
|
2020-11-24 16:12:39 +08:00
|
|
|
jobs:
|
|
|
|
ubuntu:
|
2023-08-18 18:32:19 +08:00
|
|
|
name: Code Checker AMD64 Ubuntu 20.04
|
|
|
|
runs-on: ubuntu-latest
|
2023-07-13 15:34:33 +08:00
|
|
|
timeout-minutes: 180
|
2020-11-24 16:12:39 +08:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
steps:
|
2023-11-01 09:00:14 +08:00
|
|
|
- name: Maximize build space
|
|
|
|
uses: easimon/maximize-build-space@master
|
2023-12-14 17:44:39 +08:00
|
|
|
if: ${{ ! startsWith(runner.name, 'self') }} # skip this step if it is self-hosted runner
|
2023-11-01 09:00:14 +08:00
|
|
|
with:
|
2023-12-08 16:14:07 +08:00
|
|
|
root-reserve-mb: 20480
|
2023-11-01 09:00:14 +08:00
|
|
|
swap-size-mb: 1024
|
|
|
|
remove-dotnet: 'true'
|
|
|
|
remove-android: 'true'
|
|
|
|
remove-haskell: 'true'
|
2020-11-24 16:12:39 +08:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2023-12-27 11:56:57 +08:00
|
|
|
- name: Download Caches
|
|
|
|
uses: ./.github/actions/cache
|
2020-12-09 20:07:27 +08:00
|
|
|
with:
|
2023-12-27 11:56:57 +08:00
|
|
|
os: 'ubuntu20.04'
|
2020-11-24 16:12:39 +08:00
|
|
|
- name: Code Check
|
2020-12-09 20:07:27 +08:00
|
|
|
env:
|
2022-11-23 10:39:11 +08:00
|
|
|
OS_NAME: 'ubuntu20.04'
|
2020-11-24 16:12:39 +08:00
|
|
|
run: |
|
2022-11-23 10:39:11 +08:00
|
|
|
./build/builder.sh /bin/bash -c "make check-proto-product && make verifiers"
|
2023-12-27 11:56:57 +08:00
|
|
|
|
2023-08-18 18:32:19 +08:00
|
|
|
amazonlinux:
|
|
|
|
name: Code Checker Amazonlinux 2023
|
|
|
|
# Run in amazonlinux docker
|
|
|
|
runs-on: ubuntu-latest
|
2023-07-13 15:34:33 +08:00
|
|
|
timeout-minutes: 180
|
2022-03-31 14:49:28 +08:00
|
|
|
steps:
|
2023-11-01 09:00:14 +08:00
|
|
|
- name: Maximize build space
|
|
|
|
uses: easimon/maximize-build-space@master
|
2023-12-14 17:44:39 +08:00
|
|
|
if: ${{ ! startsWith(runner.name, 'self') }} # skip this step if it is self-hosted runner
|
2023-11-01 09:00:14 +08:00
|
|
|
with:
|
2023-12-08 16:14:07 +08:00
|
|
|
root-reserve-mb: 20480
|
2023-11-01 09:00:14 +08:00
|
|
|
swap-size-mb: 1024
|
|
|
|
remove-dotnet: 'true'
|
|
|
|
remove-android: 'true'
|
|
|
|
remove-haskell: 'true'
|
2022-03-31 14:49:28 +08:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2023-12-27 11:56:57 +08:00
|
|
|
- name: Download Caches
|
|
|
|
uses: ./.github/actions/cache
|
2022-11-23 10:39:11 +08:00
|
|
|
with:
|
2023-12-27 11:56:57 +08:00
|
|
|
os: 'amazonlinux2023'
|
2022-03-31 14:49:28 +08:00
|
|
|
- name: Code Check
|
|
|
|
run: |
|
2023-09-07 15:43:15 +08:00
|
|
|
sed -i 's/ubuntu20.04/amazonlinux2023/g' .env
|
2022-11-23 10:39:11 +08:00
|
|
|
./build/builder.sh /bin/bash -c "make install"
|