diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c38e4e8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +name: orca + +on: + pull_request: + push: + branches: [ development ] + tags: [ '*' ] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + orca: + # do not run on forks or dependabot PRs + if: | + github.event_name == 'push' || + (github.event_name == 'pull_request' && + github.event.pull_request.head.repo.full_name == github.repository && + github.actor != 'dependabot[bot]') + uses: JeffersonLab/acro/.github/workflows/orca.yml@main + with: + # ref_var controls which git ref variable gets set to the triggering ref; + # - see the variables named `REF_*` in https://code.jlab.org/hallb/clas12/orca/-/blob/main/.gitlab-ci.yml?ref_type=heads + # - for example, `REF_COATJAVA` + # - here we just use a non-existent `REF_*` variable "`REF_NOOP`" (`orca` will ignore it) + ref_var: REF_NOOP + # timeout is the maximum time to allow the pipeline to run (seconds) + pipeline_timeout: 3600 + secrets: + orca_project_id: ${{ secrets.ORCA_PROJECT_ID }} + orca_project_token: ${{ secrets.ORCA_PROJECT_TOKEN }} + orca_trigger_token: ${{ secrets.ORCA_TRIGGER_TOKEN }} diff --git a/.github/workflows/orca.yml b/.github/workflows/orca.yml index bf6e997..306c4e9 100644 --- a/.github/workflows/orca.yml +++ b/.github/workflows/orca.yml @@ -85,7 +85,9 @@ jobs: steps: - name: wait for orca pipeline run: | - echo "Waiting for pipeline to complete ... checking every ${{ inputs.pipeline_timeout }} s ..." + echo "Waiting for pipeline to complete ..." + echo "... pipeline status will be queried every $SLEEP_INTERVAL s" + echo "... pipeline will fail if time exceeds timeout ${{ inputs.pipeline_timeout }} s" elapsed=0 while [ $elapsed -lt ${{ inputs.pipeline_timeout }} ]; do response=$(curl \ diff --git a/README.md b/README.md index cccd18c..efe4274 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ # acro Reusable CI workflow to trigger [`orca` pipelines](https://code.jlab.org/hallb/clas12/orca). + +Repository files: +``` +.github/ +└── workflows + ├── ci.yml # example caller workflow + └── orca.yml # the resuable workflow +``` + +2 directories, 2 files