Skip to content

CI ReSim

CI ReSim #1

Workflow file for this run

name: CI ReSim
on:
workflow_run:
workflows: ["Trigger CI ReSim"]
types:
- completed
jobs:
resim_checks:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
ref: ${{ github.event.workflow_run.head_sha }}
- name: Get PR number
uses: 8BitJonny/gh-get-current-pr@4.0.0
id: PR
with:
sha: ${{ github.event.workflow_run.head_sha }}
filterOutClosed: true
filterOutDraft: true
- name: Run ReSim
if: steps.PR.outputs.pr_found == 'true'
run: |
echo "LTX_PR_SERVER=${{ vars.LTX_PR_SERVER }}"
echo "LTX_SCRIPT_LOCATION=${{ vars.LTX_SCRIPT_LOCATION }}"
echo "LTX_TESTING_TOOLS=${{ vars.LTX_TESTING_TOOLS }}"
- name: Report status back to PR
if: steps.PR.outputs.pr_found == 'true'
uses: actions/github-script@v8
with:
script: |
const run = context.payload.workflow_run;
const sha = run.head_sha;
const conclusion = run.conclusion;
let state;
switch (conclusion) {
case "success":
state = "success";
break;
case "failure":
case "timed_out":
case "action_required":
state = "failure";
break;
case "cancelled":
case "skipped":
state = "error";
break;
default:
state = "error";
}
const prNumber = process.env.PR_NUMBER || null;
const ltxServer = process.env.LTX_PR_SERVER;
const targetUrl = prNumber ? `${ltxServer}/${prNumber}/` : ltxServer;
await github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: sha,
state: state,
context: "CI / resim_checks",
description: `ReSim finished with ${conclusion}`,
target_url: targetUrl
});
env:
PR_NUMBER: ${{ steps.PR.outputs.number }}
LTX_PR_SERVER: ${{ vars.LTX_PR_SERVER }}