diff options
| author | ruki <[email protected]> | 2025-12-02 16:16:13 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-02 16:16:13 +0800 |
| commit | bc7caf95a9cfdefed930937e8450997a4cdc8191 (patch) | |
| tree | de6f77256d55a0f49c5889b10b3962a6406673a8 /.github | |
| parent | f4533a6c109732c983329d5121929b9635409a3d (diff) | |
| parent | 73e234824c235191f430400f4bb7b39421ee1fb4 (diff) | |
Merge pull request #7088 from xmake-io/rule
Improve c++/objc rules
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/solaris.yml | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/.github/workflows/solaris.yml b/.github/workflows/solaris.yml index 9e044b036..6f4dbba76 100644 --- a/.github/workflows/solaris.yml +++ b/.github/workflows/solaris.yml @@ -19,17 +19,17 @@ jobs: script: | const fs = require('fs'); const outputFile = process.env.GITHUB_OUTPUT; - + // Always run for release events if (context.eventName === 'release') { fs.appendFileSync(outputFile, `should-run=true\n`); core.info('Release event detected. Will run tests.'); return; } - + // Execution probability (default 50%, can be overridden via env) const probability = parseFloat(process.env.RUN_PROBABILITY || '0.5'); - + // Generate deterministic "random" number based on commit SHA, run ID, and current time // Adding time ensures better randomness while keeping same commit/run consistent const timeSeed = Math.floor(Date.now() / (1000 * 60 * 60)); // Round to hour for consistency @@ -43,7 +43,7 @@ jobs: // Normalize to 0-1 range const random = Math.abs(hash) / 2147483647; const shouldRun = random < probability; - + // Use environment file instead of deprecated set-output fs.appendFileSync(outputFile, `should-run=${shouldRun}\n`); if (shouldRun) { @@ -72,7 +72,15 @@ jobs: with: usesh: true prepare: | - pkgutil -y -i socat git gmake bash gcc4g++ || pkgutil -y -i socat git gmake bash gcc5g++ || pkg install -y developer/gcc || true + # Try OpenCSW first (for older Solaris) + if command -v pkgutil >/dev/null 2>&1; then + pkgutil -U || true + pkgutil -y -i socat git gmake bash gcc4g++ 2>/dev/null || pkgutil -y -i socat git gmake bash gcc5g++ 2>/dev/null || true + fi + # Try IPS (for newer Solaris) + if command -v pkg >/dev/null 2>&1; then + pkg install --accept developer/gcc developer/build/gnu-make developer/versioning/git || true + fi run: | cd $GITHUB_WORKSPACE bash ./configure |
