mirror of
https://github.com/rustfs/rustfs.git
synced 2026-10-23 20:46:18 +00:00
1c5bbc0c47
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
65 lines
2.3 KiB
YAML
65 lines
2.3 KiB
YAML
name: Functional chain health
|
|
on:
|
|
schedule:
|
|
- cron: '23 * * * *'
|
|
workflow_dispatch:
|
|
permissions:
|
|
contents: read
|
|
actions: read
|
|
concurrency:
|
|
group: functional-chain-health
|
|
cancel-in-progress: false
|
|
jobs:
|
|
collect:
|
|
if: github.repository == 'rustfs/rustfs'
|
|
runs-on: smoke-testing
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
|
|
with:
|
|
persist-credentials: false
|
|
- name: Ensure GitHub CLI
|
|
shell: bash
|
|
run: |
|
|
if command -v gh >/dev/null 2>&1; then
|
|
gh --version
|
|
exit 0
|
|
fi
|
|
|
|
gh_version="2.101.0"
|
|
case "$(uname -m)" in
|
|
x86_64) gh_arch="amd64" ;;
|
|
aarch64|arm64) gh_arch="arm64" ;;
|
|
*)
|
|
echo "Unsupported Linux architecture for GitHub CLI: $(uname -m)" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
gh_install_root="${RUNNER_TEMP:-$PWD}/gh-cli"
|
|
rm -rf "$gh_install_root"
|
|
mkdir -p "$gh_install_root/bin"
|
|
archive="$gh_install_root/gh.tar.gz"
|
|
curl --fail --location --retry 3 \
|
|
"https://github.com/cli/cli/releases/download/v${gh_version}/gh_${gh_version}_linux_${gh_arch}.tar.gz" \
|
|
--output "$archive"
|
|
tar -xzf "$archive" -C "$gh_install_root"
|
|
install -m 0755 \
|
|
"$gh_install_root/gh_${gh_version}_linux_${gh_arch}/bin/gh" \
|
|
"$gh_install_root/bin/gh"
|
|
echo "$gh_install_root/bin" >> "$GITHUB_PATH"
|
|
export PATH="$gh_install_root/bin:$PATH"
|
|
gh --version
|
|
- name: Collect and publish verified chain health
|
|
env:
|
|
GH_TOKEN: ${{ secrets.PF_TESTING_GH_TOKEN }}
|
|
NIGHTLY_SOURCE_REF: ${{ vars.NIGHTLY_BRANCH || 'main' }}
|
|
run: python3 scripts/functional_chain_health.py --source-ref "${NIGHTLY_SOURCE_REF}" --publish --output "${RUNNER_TEMP}/chain-health.json"
|
|
- name: Retain health observation
|
|
if: always()
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: functional-chain-health-${{ github.run_id }}-${{ github.run_attempt }}
|
|
path: ${{ runner.temp }}/chain-health.json
|
|
if-no-files-found: error
|