diff options
| author | ruki <[email protected]> | 2025-12-02 23:25:17 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-12-02 23:25:17 +0800 |
| commit | 73e234824c235191f430400f4bb7b39421ee1fb4 (patch) | |
| tree | da1dc5b41be509d47a26a2deb593992bc33d31ca | |
| parent | ca52efa1eff5af56e0dc9197616e709ce1b97a25 (diff) | |
update yml
| -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 |
