diff --git a/.github/actions/message/action.yml b/.github/actions/message/action.yml index 44170adf494..814b344db3d 100644 --- a/.github/actions/message/action.yml +++ b/.github/actions/message/action.yml @@ -14,6 +14,8 @@ outputs: description: If enable native Windows build. macos: description: If enable macOS build. + validator: + description: If enable validator checks. release: description: If enable release build. diff --git a/.github/actions/message/main.js b/.github/actions/message/main.js index 0294aca8803..c7fab13daab 100644 --- a/.github/actions/message/main.js +++ b/.github/actions/message/main.js @@ -17,6 +17,7 @@ const WINDOWS_NATIVE = "E1-forcenatwin"; const MACOS = "E2-forcemacos"; const RELEASE = "E3-forcerelease"; const SKIP_CI = "[skip-ci]"; +const VALIDATOR_LABEL = "check-validator"; const [owner, repo] = ["gear-tech", "gear"]; /** @@ -75,6 +76,7 @@ async function main() { const build = !skipCI && (isDepbot || BUILD_LABELS.some((label) => labels.includes(label))); + const validator = !skipCI && labels.includes(VALIDATOR_LABEL); const win_native = !skipCI && labels.includes(WINDOWS_NATIVE); const macos = !skipCI && labels.includes(MACOS); const release = !skipCI && labels.includes(RELEASE); @@ -85,12 +87,14 @@ async function main() { core.setOutput("win-native", win_native); core.setOutput("macos", macos); core.setOutput("release", release); + core.setOutput("validator", !skipCI); console.log("---"); console.log("build: ", build); console.log("check: ", !skipCI); console.log("native windows: ", win_native); console.log("macos: ", macos); + console.log("validator: ", validator); console.log("release: ", release); // Mock checks if skipping CI. diff --git a/.github/workflows/PR.yml b/.github/workflows/PR.yml index bfef347cd75..fe6c3a62845 100644 --- a/.github/workflows/PR.yml +++ b/.github/workflows/PR.yml @@ -30,6 +30,7 @@ jobs: check: ${{ steps.config.outputs.check }} win-native: ${{ steps.config.outputs.win-native }} macos: ${{ steps.config.outputs.macos }} + validator: ${{ steps.config.outputs.validator }} release: ${{ steps.config.outputs.release }} steps: - uses: actions/checkout@v4 @@ -68,3 +69,12 @@ jobs: macos: ${{ needs.status.outputs.macos == 'true' }} win-native: ${{ needs.status.outputs.win-native == 'true' }} release: ${{ needs.status.outputs.release == 'true' }} + + validator: + needs: status + if: ${{ needs.status.outputs.validator == 'true' }} + uses: ./.github/workflows/validation.yml + secrets: + VARA_VALIDATOR_8: ${{ secrets.VARA_VALIDATOR_8 }} + SSH_VARA_USERNAME: ${{ secrets.SSH_VARA_USERNAME }} + VARA_SSH_PRIVATE_KEY: ${{ secrets.VARA_SSH_PRIVATE_KEY }} diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 4e2cc517e3a..19ac2209347 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -1,10 +1,15 @@ name: Live check on Vara Network Validator machine on: - pull_request: - types: [synchronize, labeled, opened, reopened, ready_for_review] - branches: [master] workflow_dispatch: + workflow_call: + secrets: + VARA_VALIDATOR_8: + required: true + SSH_VARA_USERNAME: + required: true + VARA_SSH_PRIVATE_KEY: + required: true env: CARGO_TERM_COLOR: always @@ -12,7 +17,6 @@ env: jobs: tag-image: runs-on: ubuntu-latest - if: contains(github.event.pull_request.labels.*.name, 'check-validator') outputs: image_tag: ${{ steps.image-tag.outputs.tag }} steps: @@ -25,10 +29,8 @@ jobs: build-update-validator: runs-on: [kuberunner] - if: contains(github.event.pull_request.labels.*.name, 'check-validator') needs: tag-image steps: - - name: Checkout repo uses: actions/checkout@v4 @@ -56,7 +58,7 @@ jobs: - name: SSH into VM uses: appleboy/ssh-action@v1.0.3 - env: + env: NEW_IMAGE: ${{ needs.tag-image.outputs.image_tag }} with: host: ${{ secrets.VARA_VALIDATOR_8 }}