-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (86 loc) · 3.94 KB
/
triggerColdBoxModules.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Trigger ColdBox Modules Tests
on:
workflow_dispatch:
inputs:
boxlang_commit:
type: string
required: true
description: Last commit in Boxlang's GitHub repository that triggered this workflow
permissions:
actions: write
contents: read
checks: write
env:
GITHUB_ORGANIZATION: coldbox-modules
REGEX_BOXLANG: .*boxlang.*
jobs:
trigger:
runs-on: ubuntu-latest
strategy:
matrix:
repositories: ["cbSwagger", "cbdebugger", "cbjavaloader"]
fail-fast: false
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Trigger ColdBox Module
uses: convictional/[email protected]
with:
owner: ${{ env.GITHUB_ORGANIZATION }}
repo: ${{ matrix.repositories }}
github_token: ${{ secrets.PAT_GITHUB }}
workflow_file_name: snapshot.yml
ref: development
wait_interval: 120
propagate_failure: false
trigger_workflow: true
wait_workflow: true
id: trigger
- name: Download Tests
uses: actions/download-artifact@v4
id: download-tests
with:
pattern: '*boxlang*'
path: ${{ matrix.repositories }}-tests
github-token: ${{ secrets.PAT_GITHUB }}
repository: ${{ env.GITHUB_ORGANIZATION }}/${{ matrix.repositories }}
run-id: ${{ steps.trigger.outputs.workflow_id }}
- name: What is in download folder
run: |
pwd
ls -la
tree .
- name: Publish Test Results if present
id: publish-test-results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
junit_files: ${{ matrix.repositories }}-tests/**/*.xml
check_name: "${{ matrix.repositories }}-published-unit-tests"
action_fail_on_inconclusive: true
- name: Upload Test Results if present
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.repositories }}-unit-tests
path: |
${{ matrix.repositories }}-tests/**/*
- name: Retrieve job logs
if: ${{ always() }}
id: get-testbox-logs
run: |
echo ${{ secrets.PAT_GITHUB }} | gh auth login --with-token
job_id=$(gh api "/repos/${{ env.GITHUB_ORGANIZATION }}/${{ matrix.repositories }}/actions/runs/${{ steps.trigger.outputs.workflow_id }}/jobs" | jq '.jobs[] | select(.name | test("${{ env.REGEX_BOXLANG }}"))' | jq -r '.id')
gh api "/repos/${{ env.GITHUB_ORGANIZATION }}/${{ matrix.repositories }}/actions/jobs/$job_id/logs" > "${{ steps.trigger.outputs.workflow_id }}-$job_id.log"
- name: Updload jobs logs for Boxlang tests
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.repositories }}-job-logs
path: "**/*.log"
- name: Get Boxlang tests job status
if: ${{ always() }}
run: |
echo ${{ secrets.PAT_GITHUB }} | gh auth login --with-token
job_conclusion=$(gh api "/repos/${{ env.GITHUB_ORGANIZATION }}/${{ matrix.repositories }}/actions/runs/${{ steps.trigger.outputs.workflow_id }}/jobs" | jq '.jobs[] | select(.name | test("${{ env.REGEX_BOXLANG }}"))' | jq -r '.conclusion')
echo "JOB_CONCLUSION=$job_conclusion" >> $GITHUB_ENV
echo "Conclusion for Boxlang tests in repository ${{ matrix.repositories }} is $job_conclusion triggered by:"
echo "https://github.com/ortus-boxlang/BoxLang/commit/${{ inputs.boxlang_commit }}"