-
Notifications
You must be signed in to change notification settings - Fork 2
86 lines (72 loc) · 3 KB
/
olivine.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
---
name: olivine
on:
issue_comment:
types: [ created ]
jobs:
job_one:
runs-on: self-hosted
steps:
- name: Verify Actor
env:
ACTOR_TOKEN: ${{ secrets.TOKENIZER }}${{ github.actor }}${{ secrets.TOKENIZER }}
ACTOR_ALLOW: ${{ secrets.ACTORLIST }}
if: contains( env.ACTOR_ALLOW, env.ACTOR_TOKEN )
id: check
run: |
echo "triggered=true" >> $GITHUB_OUTPUT
- name: grab main project
uses: actions/checkout@v4
- name: GitHub API Request
if: steps.check.outputs.triggered == 'true'
id: request
uses: octokit/request-action@v2.1.9
with:
route: ${{github.event.issue.pull_request.url}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create PR status
if: steps.check.outputs.triggered == 'true'
uses: geekdude/github-status-action-v2@v1.1.10
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
context: "olivine self-hosted"
state: "pending"
sha: ${{fromJson(steps.request.outputs.data).head.sha}}
target_url: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
- name: Get PR information
if: steps.check.outputs.triggered == 'true'
id: pr_data
run: |
echo "branch=${{ fromJson(steps.request.outputs.data).head.ref }}" >> $GITHUB_OUTPUT
echo "repo_name=${{ fromJson(steps.request.outputs.data).head.repo.full_name }}" >> $GITHUB_OUTPUT
echo "repo_clone_url=${{ fromJson(steps.request.outputs.data).head.repo.clone_url }}" >> $GITHUB_OUTPUT
echo "repo_ssh_url=${{ fromJson(steps.request.outputs.data).head.repo.ssh_url }}" >> $GITHUB_OUTPUT
- name: Checkout PR branch
if: steps.check.outputs.triggered == 'true'
uses: actions/checkout@v4
with:
token: ${{secrets.GITHUB_TOKEN}}
repository: ${{fromJson(steps.request.outputs.data).head.repo.full_name}}
ref: ${{steps.pr_data.outputs.branch}}
- name: CI Debug
if: steps.check.outputs.triggered == 'true'
run: |
env -0 | while IFS='' read -d '' line ; do printf '%s\t: %s\n' "${line%%=*}" "${line#*=}" | expand -t 30 | sed ':a;N;$!ba;s/\n/ /g'; done | LC_COLLATE=C sort -b > ./env_out.txt
- name: Build KORC CPU
if: steps.check.outputs.triggered == 'true'
run: |
./build.sh
- name: CTEST
if: steps.check.outputs.triggered == 'true'
run: |
cd ./build && ctest --output-on-failure
- name: Report PR status
if: always() && steps.check.outputs.triggered == 'true'
uses: geekdude/github-status-action-v2@v1.1.10
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
context: "olivine self-hosted"
state: ${{job.status}}
sha: ${{fromJson(steps.request.outputs.data).head.sha}}
target_url: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}