Repository navigation
128 lines (116 loc) · 3.92 KB
/
Copy pathstaging.yaml
File metadata and controls
128 lines (116 loc) · 3.92 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
122
123
124
125
126
127
128
name: Staging
on:
# schedule:
# # Run every 15 minutes offset by 7 to try to avoid github's high-load times
# # https://stackoverflow.com/questions/59560214/github-action-works-on-push-but-not-scheduled
# - cron: 7,22,37,52 * * * *
pull_request:
branches:
- main
workflow_dispatch:
inputs:
timestamp:
description: 'Patch Timestamp (UTC)'
required: true
baseline_gcc_hash:
description: 'Baseline hash'
required: false
tip_of_tree_hash:
description: 'Trunk hash'
required: false
patch_id:
description: 'Patch id'
required: false
original_patch_issue_num:
description: 'Issue number to link against'
required: false
permissions:
actions: read
contents: read
issues: read
env:
PRECOMMIT_REPOSITORY: ${{ github.repository }}
PATCHWORK_REPORTING_ENABLED: ${{ vars.PATCHWORK_REPORTING_ENABLED }}
jobs:
run-scheduled:
if: ${{ github.event_name == 'schedule' }}
uses: ./.github/workflows/patchworks.yaml
permissions:
actions: read
contents: read
issues: write
with:
timestamp: ''
baseline_gcc_hash: ''
tip_of_tree_hash: ''
patch_id: ''
original_patch_issue_num: ''
secrets: inherit
manually-triggered-workflow-dispatch:
uses: ./.github/workflows/patchworks.yaml
if: ${{ github.event_name == 'workflow_dispatch' }}
permissions:
actions: read
contents: read
issues: write
with:
timestamp: ${{ inputs.timestamp }}
baseline_gcc_hash: ${{ inputs.baseline_gcc_hash }}
tip_of_tree_hash: ${{ inputs.tip_of_tree_hash }}
patch_id: ${{ inputs.patch_id }}
original_patch_issue_num: ${{ inputs.original_patch_issue_num }}
secrets: inherit
get-patch-info:
runs-on: [self-hosted, linux, x64, rise-gcc-ci, ping]
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }}
defaults:
run:
working-directory: riscv-gnu-toolchain
steps:
- name: Cleanup build folder
working-directory: ./
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- uses: actions/checkout@v4
- name: Setup env
uses: ./.github/actions/common/setup-env
with:
free_up_space: false
- name: Install dependencies
run: |
sudo apt install python3 -y
sudo apt install python-is-python3 -y
sudo apt install zip -y
- name: Get patch data
id: data
run: |
python scripts/get_staging_patch.py -repo "${PRECOMMIT_REPOSITORY}" -token ${{ secrets.GITHUB_TOKEN }}
echo "timestamp=$(cat timestamp.txt)" >> $GITHUB_OUTPUT
echo "baseline_hash=$(cat baseline_hash.txt)" >> $GITHUB_OUTPUT
echo "tot_hash=$(cat tot_hash.txt)" >> $GITHUB_OUTPUT
echo "patch_id=$(cat patch_id.txt)" >> $GITHUB_OUTPUT
echo "issue_num=$(cat issue_num.txt)" >> $GITHUB_OUTPUT
outputs:
timestamp: ${{ steps.data.outputs.timestamp }}
baseline_gcc_hash: ${{ steps.data.outputs.baseline_hash }}
tip_of_tree_hash: ${{ steps.data.outputs.tot_hash }}
patch_id: ${{ steps.data.outputs.patch_id }}
issue_num: ${{ steps.data.outputs.issue_num }}
run-workflow:
needs: [get-patch-info]
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/workflows/patchworks.yaml
permissions:
actions: read
contents: read
issues: write
with:
timestamp: ${{ needs.get-patch-info.outputs.timestamp }}
baseline_gcc_hash: ${{ needs.get-patch-info.outputs.baseline_gcc_hash }}
tip_of_tree_hash: ${{ needs.get-patch-info.outputs.tip_of_tree_hash }}
patch_id: ${{ needs.get-patch-info.outputs.patch_id }}
original_patch_issue_num: ${{ needs.get-patch-info.outputs.issue_num }}
secrets: inherit