From 1439049ca4ec58e4fc71b23ead3f5be6674a24f8 Mon Sep 17 00:00:00 2001 From: Mikolaj Wielgus Date: Thu, 9 Jan 2025 16:30:59 +0100 Subject: [PATCH] ci: make egui and WASM builds steps instead of parallelly ran flows This will reduce momentary strain in favor of running for a longer time. Reference issue: https://codeberg.org/topola/topola/issues/155 --- .woodpecker/build_and_test.yaml | 124 +++++++++++++++++++++++++++ .woodpecker/build_cli_then_test.yaml | 65 -------------- .woodpecker/build_egui.yaml | 37 -------- .woodpecker/build_wasm.yaml | 41 --------- 4 files changed, 124 insertions(+), 143 deletions(-) create mode 100644 .woodpecker/build_and_test.yaml delete mode 100644 .woodpecker/build_cli_then_test.yaml delete mode 100644 .woodpecker/build_egui.yaml delete mode 100644 .woodpecker/build_wasm.yaml diff --git a/.woodpecker/build_and_test.yaml b/.woodpecker/build_and_test.yaml new file mode 100644 index 0000000..6f1ae82 --- /dev/null +++ b/.woodpecker/build_and_test.yaml @@ -0,0 +1,124 @@ +# SPDX-FileCopyrightText: 2024 Topola contributors +# +# SPDX-License-Identifier: MIT + +matrix: + include: + - CHANNEL: stable + FEATURES: disable_contracts + - CHANNEL: nightly + FEATURES: + +steps: + build_cli: + image: rust + environment: + RUST_BACKTRACE: 1 + CARGO_TERM_COLOR: always + commands: + - rustup default "$CHANNEL" + - cargo build -p topola-cli --no-default-features --features "$FEATURES" -- + when: + event: [pull_request, push, tag] + path: + include: + - '.woodpecker/*.yaml' + - '*.toml' + - 'crates/**' + - 'src/**' + - 'tests/**' + - 'examples/**' + exclude: + - 'assets/**' + - 'LICENSES/**' + - 'locales/**' + - '*.md' + ignore_message: '[ALL]' + on_empty: false + + # Testing is a step instead of a separate flow to reduce Codeberg's CI usage. + test: + image: rust + environment: + RUST_BACKTRACE: 1 + CARGO_TERM_COLOR: always + commands: + - rustup default "$CHANNEL" + - cargo test --verbose --no-default-features --features "$FEATURES" + when: + event: [pull_request, push, tag] + # Only run tests for stable channel to avoid straining Codeberg's CI. + evaluate: 'CHANNEL == "stable"' + path: + include: + - '.woodpecker/*.yaml' + - '*.toml' + - 'crates/**' + - 'src/**' + - 'tests/**' + - 'examples/**' + exclude: + - 'assets/**' + - 'LICENSES/**' + - 'locales/**' + - '*.md' + ignore_message: '[ALL]' + on_empty: false + + # Step instead of a separate flow to reduce Codeberg's CI usage. + build_egui: + image: rust + environment: + RUST_BACKTRACE: 1 + CARGO_TERM_COLOR: always + commands: + - rustup default "$CHANNEL" + - cargo build -p topola-egui --no-default-features --features "$FEATURES" + when: + event: [pull_request, push, tag] + path: + include: + - '.woodpecker/*.yaml' + - '*.toml' + - 'crates/**' + - 'src/**' + - 'tests/**' + - 'examples/**' + exclude: + - 'assets/**' + - 'LICENSES/**' + - 'locales/**' + - '*.md' + ignore_message: '[ALL]' + on_empty: false + + # Step instead of a separate flow to reduce Codeberg's CI usage. + build_wasm: + image: rust + environment: + RUST_BACKTRACE: 1 + CARG_TERM_COLOR: always + commands: + - apt-get -y install curl + - curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash + - cargo binstall --no-confirm trunk + - rustup default "$CHANNEL" + - rustup target add wasm32-unknown-unknown + - trunk build + when: + event: [pull_request, push, tag] + path: + include: + - '.woodpecker/*.yaml' + - '*.toml' + - 'crates/**' + - 'src/**' + - 'tests/**' + - 'examples/**' + exclude: + - 'assets/**' + - 'LICENSES/**' + - 'locales/**' + - '*.md' + ignore_message: '[ALL]' + on_empty: false diff --git a/.woodpecker/build_cli_then_test.yaml b/.woodpecker/build_cli_then_test.yaml deleted file mode 100644 index 0571658..0000000 --- a/.woodpecker/build_cli_then_test.yaml +++ /dev/null @@ -1,65 +0,0 @@ -# SPDX-FileCopyrightText: 2024 Topola contributors -# -# SPDX-License-Identifier: MIT - -matrix: - include: - - CHANNEL: stable - FEATURES: disable_contracts - - CHANNEL: nightly - FEATURES: - -steps: - build_cli: - image: rust - environment: - RUST_BACKTRACE: 1 - CARGO_TERM_COLOR: always - commands: - - rustup default "$CHANNEL" - - cargo build -p topola-cli --no-default-features --features "$FEATURES" -- - when: - event: [pull_request, push, tag] - path: - include: - - '.woodpecker/*.yaml' - - '*.toml' - - 'crates/**' - - 'src/**' - - 'tests/**' - - 'examples/**' - exclude: - - 'assets/**' - - 'LICENSES/**' - - 'locales/**' - - '*.md' - ignore_message: '[ALL]' - on_empty: false - - # Testing is a step instead of a separate flow to reduce Codeberg's CI usage. - test: - image: rust - environment: - RUST_BACKTRACE: 1 - CARGO_TERM_COLOR: always - commands: - - cargo test --verbose --no-default-features --features "$FEATURES" - when: - event: [pull_request, push, tag] - # Only run tests for stable channel to avoid straining Codeberg's CI. - evaluate: 'CHANNEL == "stable"' - path: - include: - - '.woodpecker/*.yaml' - - '*.toml' - - 'crates/**' - - 'src/**' - - 'tests/**' - - 'examples/**' - exclude: - - 'assets/**' - - 'LICENSES/**' - - 'locales/**' - - '*.md' - ignore_message: '[ALL]' - on_empty: false diff --git a/.woodpecker/build_egui.yaml b/.woodpecker/build_egui.yaml deleted file mode 100644 index 89da3fa..0000000 --- a/.woodpecker/build_egui.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# SPDX-FileCopyrightText: 2024 Topola contributors -# -# SPDX-License-Identifier: MIT - -matrix: - include: - - CHANNEL: stable - FEATURES: disable_contracts,xdg-portal - - CHANNEL: nightly - FEATURES: xdg-portal - -steps: - build_egui: - image: rust - environment: - RUST_BACKTRACE: 1 - CARGO_TERM_COLOR: always - commands: - - rustup default "$CHANNEL" - - cargo build -p topola-egui --no-default-features --features "$FEATURES" - when: - event: [pull_request, push, tag] - path: - include: - - '.woodpecker/*.yaml' - - '*.toml' - - 'crates/**' - - 'src/**' - - 'tests/**' - - 'examples/**' - exclude: - - 'assets/**' - - 'LICENSES/**' - - 'locales/**' - - '*.md' - ignore_message: '[ALL]' - on_empty: false diff --git a/.woodpecker/build_wasm.yaml b/.woodpecker/build_wasm.yaml deleted file mode 100644 index 19d989a..0000000 --- a/.woodpecker/build_wasm.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# SPDX-FileCopyrightText: 2024 Topola contributors -# -# SPDX-License-Identifier: MIT - -matrix: - include: - - CHANNEL: stable - FEATURES: disable_contracts - - CHANNEL: nightly - FEATURES: - -steps: - build_wasm: - image: rust - environment: - RUST_BACKTRACE: 1 - CARG_TERM_COLOR: always - commands: - - apt-get -y install curl - - curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash - - cargo binstall --no-confirm trunk - - rustup default "$CHANNEL" - - rustup target add wasm32-unknown-unknown - - trunk build - when: - event: [pull_request, push, tag] - path: - include: - - '.woodpecker/*.yaml' - - '*.toml' - - 'crates/**' - - 'src/**' - - 'tests/**' - - 'examples/**' - exclude: - - 'assets/**' - - 'LICENSES/**' - - 'locales/**' - - '*.md' - ignore_message: '[ALL]' - on_empty: false