ci: reduce native test compilation and artifact upload overhead
This commit is contained in:
1 parent
8760eef788
commit
948a427280
6 files changed
+67
-2
No files matched your search
@@ -0,0 +1,23 @@
|
||||
# Test compilation only; packaging continues to use profile.release.
|
||||
# Named dependency overrides take precedence over "*", so reset those too.
|
||||
[profile.ci]
|
||||
inherits = "dev"
|
||||
opt-level = 0
|
||||
debug = 0
|
||||
debug-assertions = true
|
||||
overflow-checks = true
|
||||
split-debuginfo = "off"
|
||||
incremental = false
|
||||
codegen-units = 256
|
||||
lto = false
|
||||
|
||||
[profile.ci.package]
|
||||
"*" = { opt-level = 0 }
|
||||
resvg = { opt-level = 0 }
|
||||
rustybuzz = { opt-level = 0 }
|
||||
taffy = { opt-level = 0 }
|
||||
ttf-parser = { opt-level = 0 }
|
||||
smol = { opt-level = 0 }
|
||||
gpui = { opt-level = 0 }
|
||||
gpui_macros = { opt-level = 0 }
|
||||
nebula_terminal = { opt-level = 0 }
|
||||
@@ -10,6 +10,7 @@ on:
|
||||
- "Cargo.lock"
|
||||
- "rust-toolchain.toml"
|
||||
- ".github/workflows/linux-lua.yml"
|
||||
- ".github/ci-profile.toml"
|
||||
pull_request:
|
||||
paths:
|
||||
- "**/*.rs"
|
||||
@@ -18,6 +19,7 @@ on:
|
||||
- "Cargo.lock"
|
||||
- "rust-toolchain.toml"
|
||||
- ".github/workflows/linux-lua.yml"
|
||||
- ".github/ci-profile.toml"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
@@ -174,6 +174,7 @@ jobs:
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
compression-level: 0
|
||||
name: native-timings-${{ matrix.platform }}
|
||||
path: target/cargo-timings
|
||||
if-no-files-found: warn
|
||||
@@ -283,6 +284,7 @@ jobs:
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
compression-level: 0
|
||||
name: stable-package-linux-x64
|
||||
path: |
|
||||
dist/*.AppImage
|
||||
@@ -294,6 +296,7 @@ jobs:
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
compression-level: 0
|
||||
name: stable-evidence-linux-x64
|
||||
path: dist/conformance
|
||||
if-no-files-found: warn
|
||||
@@ -424,6 +427,7 @@ jobs:
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
compression-level: 0
|
||||
name: stable-package-macos-${{ matrix.asset_architecture }}
|
||||
path: dist/*.dmg
|
||||
if-no-files-found: error
|
||||
@@ -432,6 +436,7 @@ jobs:
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
compression-level: 0
|
||||
name: stable-evidence-macos-${{ matrix.architecture }}
|
||||
path: dist/conformance
|
||||
if-no-files-found: warn
|
||||
@@ -502,6 +507,7 @@ jobs:
|
||||
- name: Retain built Windows runtime before packaging
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
compression-level: 0
|
||||
name: stable-runtime-windows-x64
|
||||
path: |
|
||||
target/release/pebrel.exe
|
||||
@@ -536,6 +542,7 @@ jobs:
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
compression-level: 0
|
||||
name: stable-package-windows-x64
|
||||
path: |
|
||||
dist/Pebrel-v${{ needs.prepare.outputs.version }}-windows-x64.zip
|
||||
@@ -546,6 +553,7 @@ jobs:
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
compression-level: 0
|
||||
name: stable-evidence-windows-x64
|
||||
path: dist/conformance
|
||||
if-no-files-found: warn
|
||||
@@ -593,6 +601,7 @@ jobs:
|
||||
- name: Upload complete stable release set
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
compression-level: 0
|
||||
name: Pebrel-v${{ needs.prepare.outputs.version }}
|
||||
path: release-dist
|
||||
if-no-files-found: error
|
||||
|
||||
@@ -434,6 +434,11 @@ settings files.
|
||||
platform still runs the complete Python helper and harness suites. Cache keys
|
||||
preserve the existing platform namespace and retain workspace crates. Cargo
|
||||
still validates source, profile and feature fingerprints before reuse.
|
||||
- **Test profile:** An explicit CI-only profile removes developer-preview
|
||||
optimization and debug information from test compilation, including named
|
||||
dependency overrides. It retains debug assertions and overflow checks. The
|
||||
native suite also checks the actual product feature configuration, since GPUI
|
||||
test support changes dependency features. Release optimization is unaffected.
|
||||
- **Product compilation:** The application keeps O3 and Thin LTO and uses 16
|
||||
codegen units to parallelize its large translation unit. Other package settings
|
||||
retain their existing values. Both Windows packagers call one explicit builder
|
||||
|
||||
@@ -8,11 +8,16 @@ import sys
|
||||
|
||||
|
||||
def native_commands() -> list[list[str]]:
|
||||
profile = ["--config", ".github/ci-profile.toml", "--profile", "ci"]
|
||||
return [
|
||||
[sys.executable, "-m", "unittest", "discover", "-s", "scripts/tests", "-v"],
|
||||
[sys.executable, "-m", "unittest", "discover", "-s", "scripts/conformance/tests", "-v"],
|
||||
[
|
||||
"cargo", "test", "--locked", "--workspace",
|
||||
"cargo", "check", "--locked", *profile, "-p", "nebula", "--bin", "pebrel",
|
||||
"--features", "gpui-shell", "--timings",
|
||||
],
|
||||
[
|
||||
"cargo", "test", "--locked", *profile, "--workspace",
|
||||
"--features", "nebula/gpui-test-support", "--timings",
|
||||
],
|
||||
]
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
import tomllib
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
@@ -9,7 +11,7 @@ from scripts.ci_native_tests import main, native_commands
|
||||
|
||||
class NativeSuiteTests(unittest.TestCase):
|
||||
def test_full_workspace_and_interactions_share_one_unfiltered_invocation(self):
|
||||
rust = [command for command in native_commands() if command[0] == "cargo"]
|
||||
rust = [command for command in native_commands() if command[:2] == ["cargo", "test"]]
|
||||
self.assertEqual(len(rust), 1)
|
||||
command = rust[0]
|
||||
self.assertEqual(command[1], "test")
|
||||
@@ -21,6 +23,25 @@ class NativeSuiteTests(unittest.TestCase):
|
||||
self.assertNotIn("--skip", command)
|
||||
self.assertNotIn("--", command)
|
||||
|
||||
def test_actual_product_feature_graph_is_also_checked(self):
|
||||
checks = [command for command in native_commands() if command[:2] == ["cargo", "check"]]
|
||||
self.assertEqual(len(checks), 1)
|
||||
command = checks[0]
|
||||
self.assertEqual(command[command.index("--features") + 1], "gpui-shell")
|
||||
self.assertEqual(command[command.index("--bin") + 1], "pebrel")
|
||||
|
||||
def test_fast_test_profile_preserves_runtime_checks_and_resets_named_overrides(self):
|
||||
root = Path(__file__).resolve().parents[2]
|
||||
config = tomllib.loads((root / ".github/ci-profile.toml").read_text())
|
||||
workspace = tomllib.loads((root / "Cargo.toml").read_text())
|
||||
profile = config["profile"]["ci"]
|
||||
self.assertEqual(profile["inherits"], "dev")
|
||||
self.assertTrue(profile["debug-assertions"])
|
||||
self.assertTrue(profile["overflow-checks"])
|
||||
for package in workspace["profile"]["dev"]["package"]:
|
||||
self.assertEqual(profile["package"][package]["opt-level"], 0)
|
||||
self.assertNotIn("release", config["profile"])
|
||||
|
||||
def test_both_python_test_roots_are_discovered(self):
|
||||
suites = [command for command in native_commands() if "unittest" in command]
|
||||
self.assertEqual(
|
||||
|
||||
Reference in new issue
Block a user