From f714922a78741032de9d24c0153f15bf86cc65e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Gaspard?= Date: Fri, 27 Oct 2023 16:05:14 +0000 Subject: [PATCH] copy remaining buildkite workflows to github actions --- .github/workflows/backward_compat.yml | 23 +++++++++ .github/workflows/db_migration.yml | 20 ++++++++ .../workflows/protobuf_backward_compat.yml | 24 +++++++++ .github/workflows/sanity_checks.yml | 50 +++++++++++++++++++ .github/workflows/upgradability.yml | 20 ++++++++ 5 files changed, 137 insertions(+) create mode 100644 .github/workflows/backward_compat.yml create mode 100644 .github/workflows/db_migration.yml create mode 100644 .github/workflows/protobuf_backward_compat.yml create mode 100644 .github/workflows/sanity_checks.yml create mode 100644 .github/workflows/upgradability.yml diff --git a/.github/workflows/backward_compat.yml b/.github/workflows/backward_compat.yml new file mode 100644 index 00000000000..ab35c2350aa --- /dev/null +++ b/.github/workflows/backward_compat.yml @@ -0,0 +1,23 @@ +name: Backward compatibility + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + pull_request: + merge_group: + +jobs: + cargo_nextest: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - run: | + cd pytest + pip3 install --user -r requirements.txt + pwd + ls .. + python3 tests/sanity/backward_compatible.py + ls ../target/debug diff --git a/.github/workflows/db_migration.yml b/.github/workflows/db_migration.yml new file mode 100644 index 00000000000..b8e24fbc6c7 --- /dev/null +++ b/.github/workflows/db_migration.yml @@ -0,0 +1,20 @@ +name: Upgradability + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + pull_request: + merge_group: + +jobs: + cargo_nextest: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - run: | + cd pytest + pip3 install --user -r requirements.txt + python3 tests/sanity/db_migration.py diff --git a/.github/workflows/protobuf_backward_compat.yml b/.github/workflows/protobuf_backward_compat.yml new file mode 100644 index 00000000000..dfa23057ed3 --- /dev/null +++ b/.github/workflows/protobuf_backward_compat.yml @@ -0,0 +1,24 @@ +name: Protobuf backwards compatibility + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + pull_request: + merge_group: + +jobs: + cargo_nextest: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - run: sudo apt install npm + - run: npm install @bufbuild/buf + # We need to manually fetch the latest commit of master to + # correctly compute the commit at which we should diff the proto + # files. Apparently the pipeline doesn't do that for us. + - run: git fetch origin + - run: git merge-base origin/master HEAD + - run: npx buf breaking --against ".git#ref=$(git merge-base origin/master HEAD)" diff --git a/.github/workflows/sanity_checks.yml b/.github/workflows/sanity_checks.yml new file mode 100644 index 00000000000..12e94d87d90 --- /dev/null +++ b/.github/workflows/sanity_checks.yml @@ -0,0 +1,50 @@ +name: Sanity checks + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + pull_request: + merge_group: + +jobs: + cargo_nextest: + runs-on: ubuntu-22.04-16core + strategy: + fail-fast: false + timeout-minutes: 90 + + steps: + - uses: actions/checkout@v2 + - run: cargo build -p neard --bin neard --features nightly + - name: run spin_up_cluster.py + # Note: We're not running spin_up_cluster.py for non-nightly + # because spinning up non-nightly clusters is already covered + # by other steps in the CI, e.g. upgradable. + run: | + cd pytest + python3 -m pip install --progress-bar off --user -r requirements.txt + python3 tests/sanity/spin_up_cluster.py + + - run: cargo build -p neard --bin neard + - run: python3 scripts/state/update_res.py check + + - run: python3 scripts/check_nightly.py + - run: python3 scripts/check_pytests.py + - run: python3 scripts/check_fuzzing.py + + - run: python3 scripts/fix_nightly_feature_flags.py + + - run: ./scripts/formatting --check + + - name: check rpc_errors_schema.json + - run: | + rm -f target/rpc_errors_schema.json + cargo check -p near-jsonrpc --features dump_errors_schema + if ! git --no-pager diff --no-index chain/jsonrpc/res/rpc_errors_schema.json target/rpc_errors_schema.json; then + set +x + echo 'The RPC errors schema reflects outdated typing structure; please run' + echo ' ./chain/jsonrpc/build_errors_schema.sh' + exit 1 + fi >&2 diff --git a/.github/workflows/upgradability.yml b/.github/workflows/upgradability.yml new file mode 100644 index 00000000000..7a7432efe95 --- /dev/null +++ b/.github/workflows/upgradability.yml @@ -0,0 +1,20 @@ +name: Upgradability + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + pull_request: + merge_group: + +jobs: + cargo_nextest: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - run: | + cd pytest + pip3 install --user -r requirements.txt + python3 tests/sanity/upgradable.py