summaryrefslogtreecommitdiff
path: root/.github/workflows/archlinux.yml
diff options
context:
space:
mode:
authorruki <[email protected]>2026-02-14 17:39:50 +0800
committerruki <[email protected]>2026-02-14 17:39:50 +0800
commite580c6c06087a4181db1bac5edcb5b0a45da51c9 (patch)
tree331d3d38ef4825d9672ae8d3a3272a7a5b4102d9 /.github/workflows/archlinux.yml
parent021f8144f2686305795b61a90ef040ee98f139ef (diff)
fix ci
Diffstat (limited to '.github/workflows/archlinux.yml')
-rw-r--r--.github/workflows/archlinux.yml13
1 files changed, 6 insertions, 7 deletions
diff --git a/.github/workflows/archlinux.yml b/.github/workflows/archlinux.yml
index 7ee73fe47..03118bbb8 100644
--- a/.github/workflows/archlinux.yml
+++ b/.github/workflows/archlinux.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 20%, can be overridden via env)
const probability = parseFloat(process.env.RUN_PROBABILITY || '0.2');
-
+
// 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) {
@@ -63,8 +63,8 @@ jobs:
concurrency:
# Prevent concurrent runs of the same workflow
- group: Archlinux-${{ github.event.repository.owner.login }}-${{ github.event.repository.name }}
- cancel-in-progress: false
+ group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Archlinux
+ cancel-in-progress: true
steps:
- name: Prepare build tools
run: |
@@ -90,4 +90,3 @@ jobs:
run: |
xmake lua -v -D tests/run.lua
xrepo --version
-