-
Notifications
You must be signed in to change notification settings - Fork 2
121 lines (113 loc) · 5.25 KB
/
devel-sofa-all.yml
File metadata and controls
121 lines (113 loc) · 5.25 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: devel-sofa-all
on:
# schedule:
# Nightly launches at 1:15
# - cron: '15 1 * * *'
workflow_dispatch:
inputs:
sofa-git-sha:
description: 'SOFA git commit SHA1'
required: true
type: string
default: 'master'
sofa-git-commit-date:
description: 'SOFA git commit date'
required: true
type: string
default: 'NODATE' # for testing
sofa-python3-git-sha:
description: 'sofa-python3 git commit SHA1'
required: true
type: string
default: 'master'
sofa-python3-git-commit-date:
description: 'sofa-python3 git commit date'
required: true
type: string
default: 'NODATE' # for testing
repository_dispatch:
types: [build-devel-sofa-all]
jobs:
extract-params:
runs-on: ubuntu-slim
outputs:
sofa-git-sha: ${{ steps.params.outputs.sofa-git-sha }}
sofa-git-commit-date: ${{ steps.params.outputs.sofa-git-commit-date }}
sofa-python3-git-sha: ${{ steps.params.outputs.sofa-python3-git-sha }}
sofa-python3-git-commit-date: ${{ steps.params.outputs.sofa-python3-git-commit-date }}
steps:
- name: Extract parameters
id: params
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "sofa-git-sha=${{ inputs.sofa-git-sha }}" >> $GITHUB_OUTPUT
echo "sofa-git-commit-date=${{ inputs.sofa-git-commit-date }}" >> $GITHUB_OUTPUT
echo "sofa-python3-git-sha=${{ inputs.sofa-python3-git-sha }}" >> $GITHUB_OUTPUT
echo "sofa-python3-git-commit-date=${{ inputs.sofa-python3-git-commit-date }}" >> $GITHUB_OUTPUT
elif [ "${{ github.event_name }}" == "repository_dispatch" ]; then
echo "sofa-git-sha=${{ github.event.client_payload.sofa_commit_hash }}" >> $GITHUB_OUTPUT
echo "sofa-git-commit-date=${{ github.event.client_payload.sofa_commit_date }}" >> $GITHUB_OUTPUT
echo "sofa-python3-git-sha=${{ github.event.client_payload.sofa_python3_commit_hash }}" >> $GITHUB_OUTPUT
echo "sofa-python3-git-commit-date=${{ github.event.client_payload.sofa_python3_commit_date }}" >> $GITHUB_OUTPUT
fi
- name: Check parameters
run: |
echo "✓ sofa-git-sha: ${{ steps.params.outputs.sofa-git-sha }}"
echo "✓ sofa-git-commit-date: ${{ steps.params.outputs.sofa-git-commit-date }}"
echo "✓ sofa-python3-git-sha: ${{ steps.params.outputs.sofa-python3-git-sha }}"
echo "✓ sofa-python3-git-commit-date: ${{ steps.params.outputs.sofa-python3-git-commit-date }}"
notify-begin:
runs-on: ubuntu-slim
if: ${{ github.event_name == 'repository_dispatch' }}
needs: extract-params
steps:
- name: Notify commit begin
shell: bash
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PERF_REG_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/sofa-framework/sofa/statuses/${{ needs.extract-params.outputs.sofa-git-sha }} \
-d '{"state":"pending","target_url":"https://github.com/sofa-framework/conda-ci/actions/runs/${{ github.run_id }}","description":"Conda devel packages build started...","context":"conda-ci"}'
build-publish-sofa:
uses: ./.github/workflows/devel-sofa.yml
if: always()
needs: extract-params
with:
git-sha: ${{ needs.extract-params.outputs.sofa-git-sha }}
git-commit-date: ${{ needs.extract-params.outputs.sofa-git-commit-date }}
secrets: inherit
build-publish-sofa-python3:
uses: ./.github/workflows/devel-sofa-python3.yml
needs: [build-publish-sofa, extract-params]
if: ${{ needs.build-publish-sofa.result == 'success' }}
with:
git-sha: ${{ needs.extract-params.outputs.sofa-python3-git-sha }}
git-commit-date: ${{ needs.extract-params.outputs.sofa-python3-git-commit-date }}
sofa-git-sha: ${{ needs.extract-params.outputs.sofa-git-sha }}
secrets: inherit
notify-end:
runs-on: ubuntu-slim
if: ${{ always() && github.event_name == 'repository_dispatch' }}
needs: [extract-params, build-publish-sofa, build-publish-sofa-python3]
steps:
- name: Get status from package build
shell: bash
run: |
if [[ "${{ needs.build-publish-sofa.result }}" == "success" && "${{ needs.build-publish-sofa-python3.result }}" == "success" ]]; then
echo "COMMIT_STATUS=success" >> $GITHUB_ENV
else
echo "COMMIT_STATUS=failure" >> $GITHUB_ENV
fi
- name: Notify commit end
shell: bash
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PERF_REG_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/sofa-framework/sofa/statuses/${{ needs.extract-params.outputs.sofa-git-sha }} \
-d '{"state":"${{ env.COMMIT_STATUS }}","target_url":"https://github.com/sofa-framework/conda-ci/actions/runs/${{ github.run_id }}","description":"Conda devel packages build completed with ${{ steps.run_perf_tests.outcome }}","context":"conda-ci"}'