Skip to content

GitHub Actions Pipeline scripts for CI #3

GitHub Actions Pipeline scripts for CI

GitHub Actions Pipeline scripts for CI #3

name: gw-ci-orion
# A GitHub Action that creates a deployment for a PR, clones, builds and runs a test suite
# This workflow is triggered by a label being added to a PR
# The label name determines the environment to deploy to
# The label name must be one of the following:
# - CI-Orion-Ready
# - CI-Orion-Build
# - CI-Orion-Run
on:
pull_request:
types:
- labeled
env:
HOMEgfs: ${{ github.workspace }}/${{ github.event.pull_request.number }}
HOMEgfs_PR: ${{ github.workspace }}/${{ github.event.pull_request.number }}
RUNTESTS: ${{ github.workspace }}/${{ github.event.pull_request.number }}/RUNTESTS
MACHINE_ID: orion
jobs:
checkout-build-link:
if: github.event.label.name == 'CI-Orion-Ready'
runs-on: [self-hosted, orion-ready]
timeout-minutes: 600
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: ${{ github.event.pull_request.number }}
- name: Checkout components
env:
HOMEgfs: ${{ github.workspace }}/${{ github.event.pull_request.number }}
run: |
cd ${{ env.HOMEgfs }}/sorc
./checkout.sh # Options e.g. -g -u can be added late
- name: Build executables
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ startsWith(github.event.comment.body, '/remove-labels') }}
with:
labels: "CI-Orion-Ready"
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.comment.body, '/add-labels') }}
with:
labels: "CI-Orion-Building"
run: |
cd ${{ env.HOMEgfs }}/sorc
./build_all.sh
if: ${{ failure() }}
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ startsWith(github.event.comment.body, '/remove-labels') }}
with:
labels: "CI-Orion-Building"
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.comment.body, '/add-labels') }}
with:
labels: "CI-Orion-Failed"
- name: Link artifacts
run: |
cd ${{ env.HOMEgfs }}/sorc
./link_workflow.sh
if: success() || failure()
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ startsWith(github.event.comment.body, '/remove-labels') }}
with:
labels: "CI-Orion-Building"
if: failure()
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.comment.body, '/add-labels') }}
with:
labels: "CI-Orion-Failed"
if: success()
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.comment.body, '/add-labels') }}
with:
labels: "CI-Orion-Running"
create-experiments:
needs: checkout-build-link
runs-on: [self-hosted, orion-ready]
name: Create Experiments
strategy:
matrix:
pslot: ["C48_S2S"]
steps:
- name: Create Experiment: ${{ matrix.pslot }}

Check failure on line 90 in .github/workflows/globalworkflow-ci.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/globalworkflow-ci.yaml

Invalid workflow file

You have an error in your yaml syntax on line 90
env:
pslot: ${{ matrix.pslot }}
run: |
cd ${{ env.HOMEgfs }}
source workflow/gw_setup.sh
source ci/platforms/orion.sh
./ci/scripts/create_experiment.py --yaml ci/cases/${{ matrix.pslot }}.yaml --dir ${{ env.HOMEgfs }}
if: failure()
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ startsWith(github.event.comment.body, '/remove-labels') }}
with:
labels: "CI-Orion-Running"
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.comment.body, '/add-labels') }}
with:
labels: "CI-Orion-Failed"
run-experiments:
needs: create-experiments
runs-on: [self-hosted, orion-ready]
strategy:
matrix:
pslot: ["C48_S2S"]
steps:
- name: Run Experiment: ${{ matrix.pslot }}
env:
pslot: ${{ matrix.pslot }}
EXPDIR: ${{ env.RUNTESTS }}/${{ matrix.pslot }}/EXPDIR
run: |
cd ${{ env.HOMEgfs }}
source ci/platforms/orion.sh
./ci/scripts/run-check_ci.sh
if: failure()
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ startsWith(github.event.comment.body, '/remove-labels') }}
with:
labels: "CI-Orion-Running"
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.comment.body, '/add-labels') }}
with:
labels: "CI-Orion-Failed"
uses: actions-ecosystem/action-create-comment@v1
if: ${{ startsWith(github.event.comment.body, '/hello') }}
with:
body: |
${{ env.HOMEgfs}}/global-workflow.log
release-lock:
needs: run-experiments
runs-on: [self-hosted, orion-ready]
steps:
- name: Release lock
uses: actions-ecosystem/action-remove-labels@v1
if: ${{ startsWith(github.event.comment.body, '/remove-labels') }}
with:
labels: "CI-Orion-Running"
uses: actions-ecosystem/action-add-labels@v1
if: ${{ startsWith(github.event.comment.body, '/add-labels') }}
with:
labels: "CI-Orion-Passed"