-
Notifications
You must be signed in to change notification settings - Fork 8
108 lines (103 loc) · 3.91 KB
/
gpu_tests.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
98
99
100
101
102
103
104
105
106
107
108
name: GPU acceptance tests
on:
workflow_dispatch:
inputs:
merge_target:
description: "The branch to which this branch should be compared to filter out costly tests (default: main)"
required: false
default: main
type: string
workflow_call:
inputs:
merge_target:
description: "The branch to which this branch should be compared to filter out costly tests"
required: true
type: string
SHA:
description: "The SHA of the commit being tested"
required: true
type: string
pr_number:
description: "The number of the pull request that triggered the test"
required: false
type: number
is_duplicate:
description: "Indicate if the run would be a duplicate"
required: false
default: false
type: boolean
concurrency:
group: ${{ github.event_name != 'workflow_dispatch' && format('{0}-{1}', github.workflow, inputs.pr_number) || github.run_id }}
cancel-in-progress: true
jobs:
trigger_gpu_tests:
runs-on: ubuntu-latest
environment: 'GitLab GPU trigger'
steps:
- name: Checkout gyselalibxx
if: ${{ ! inputs.is_duplicate }}
uses: actions/checkout@v4
- name: "Filter tests"
if: ${{ ! inputs.is_duplicate }}
uses: ./.github/actions/test_filter
with:
base_sha: ${{ inputs.merge_target }}
trigger_type: ${{ github.event_name }}
- name: "Send to persee"
if: ${{ ! inputs.is_duplicate }}
run: |
git clone https://ci_bot:${GITLAB_PAT}@gitlab.maisondelasimulation.fr/gysela-developpers/gyselalibxx.git --single-branch --branch trigger_persee
cd gyselalibxx
git config --global user.name "GitHub CI Documentation builder"
git config --global user.email "[email protected]"
echo "${GITHUB_REPOSITORY}" > repo
echo "${{ inputs.SHA || github.sha }}" > commit
git commit -m "Test commit ${{ inputs.SHA || github.sha }}" repo commit
git push
shell: bash
env:
GITLAB_PAT: ${{secrets.GITLAB_PAT}}
- name: "Get bot token"
if: ${{ inputs.is_duplicate }}
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: 1132905
private-key: ${{ secrets.BOT_PEM }}
- name: "Validate GPU using previous success"
if: ${{ inputs.is_duplicate }}
run: |
curl -L -X POST \
--header "Accept: application/vnd.github+json" \
--header "X-GitHub-Api-Version: 2022-11-28" \
--header "Authorization: token ${{ steps.app-token.outputs.token }}" \
https://api.github.com/repos/${GITHUB_REPOSITORY}/check-runs \
-d "{\"name\":\"GPU Tests\",\"head_sha\":\"${{ inputs.SHA || github.sha }}\",\"status\":\"completed\", \"conclusion\":\"success\",\"output\":{\"title\":\"GPU Test\",\"summary\":\"Previous success is still valid. Tests were not rerun\"}"
#gpu_tests:
# runs-on: self-hosted
# environment: development
# steps:
# - name: Checkout gyselalibxx
# if: ${{ ! inputs.is_duplicate }}
# uses: actions/checkout@v4
# with:
# submodules: recursive
# - name: "Filter tests"
# if: ${{ ! inputs.is_duplicate }}
# uses: ./.github/actions/test_filter
# with:
# base_sha: ${{ inputs.merge_target }}
# trigger_type: ${{ github.event_name }}
# - name: Setup environment
# if: ${{ ! inputs.is_duplicate }}
# run: |
# . toolchains/v100.persee/environment.sh
# shell: bash
# - name: Build code
# if: ${{ ! inputs.is_duplicate }}
# uses: ./.github/actions/build_code
# with:
# toolchain: toolchains/v100.persee/toolchain.cmake
# - name: Run tests
# if: ${{ ! inputs.is_duplicate }}
# uses: ./.github/actions/run_tests