forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
178 lines (159 loc) · 6.18 KB
/
main.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# 💎 Main Workflow: eQuantum MEC30
name: COmpendium of RElations – Modulo 6
#
# The semantics for running shell commands in GitHub actions is non-obvious. Please read
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
# before modifying this file.
#
# GitHub Actions files can be difficult to modify with confidence, because testing changes
# often requires pushing to a branch and running CI remotely.
#
# To make this process easier, consider the following:
#
# 1) Use Visual Studio Code with the GitHub Actions Extension (github.vscode-github-actions).
# This allows you to check the validity of your action schema and syntax without pushing.
# 2) Use https://github.com/nektos/act to run your CI steps locally. It will only work with
# steps run on Linux platforms, as `act` is implemented with Docker containers.
#
# For more information on these settings, see https://www.tensorflow.org/quantum/design.
#
on:
#push:
workflow_run:
types: [completed]
workflows: ["pages-build-deployment"]
# 🕸️ Allow concurrent
concurrency:
group: "pages"
cancel-in-progress: true
# ⚠️ Set token permissions
permissions: write-all
# 🕸️ Global Environment
env:
TARGET_REPOSITORY: ${{ vars.TARGET_REPOSITORY }}
jobs:
lexering:
strategy:
max-parallel: 1
fail-fast: true
matrix:
config:
- { os: ubuntu-latest, id: 1 }
- { os: macos-latest, id: 2 }
env:
ID: ${{ matrix.config.id }}
# 🔧 Commutation relations
runs-on: ${{ matrix.config.os }}
if: ${{ github.event_name == 'push' ||
github.event.workflow_run.conclusion == 'success' }}
steps:
- name: 📂 Checkout
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.ACCESS_TOKEN }}
ref: ${{ env.ID != 1 && 'gh-source' || '' }}
repository: ${{ env.ID != 1 && env.TARGET_REPOSITORY || '' }}
- name: ⚙️ Build Maps
uses: eq19/maps@v2
id: build-parser
with:
id: ${{ matrix.config.id }}
token: ${{ secrets.ACCESS_TOKEN }}
credentials: ${{ secrets.GCP_CREDENTIALS }}
docker_hub_token: ${{ secrets.DOCKER_HUB_TOKEN }}
docker_hub_password: ${{ secrets.DOCKER_HUB_PASSWORD }}
initiate_pauli_sum: ${{ toJSON(steps.set-lexering.outputs) }}
- name: 🪂 Feed Mapping
uses: eq19/feed@v3
id: feed-mapping
with:
id: ${{ matrix.config.id }}
token: ${{ secrets.ACCESS_TOKEN }}
credentials: ${{ secrets.GCP_CREDENTIALS }}
docker_hub_token: ${{ secrets.DOCKER_HUB_TOKEN }}
docker_hub_password: ${{ secrets.DOCKER_HUB_PASSWORD }}
initiate_pauli_sum: ${{ toJSON(steps.build-parser.outputs) }}
- name: 🏃♂️ Lexering Runner
uses: eq19/lexer@v3
id: set-lexering
with:
id: ${{ matrix.config.id }}
token: ${{ secrets.ACCESS_TOKEN }}
credentials: ${{ secrets.GCP_CREDENTIALS }}
docker_hub_token: ${{ secrets.DOCKER_HUB_TOKEN }}
docker_hub_password: ${{ secrets.DOCKER_HUB_PASSWORD }}
initiate_pauli_sum: ${{ toJSON(steps.feed-mapping.outputs) }}
- name: 📋 Generate Outputs
id: gen_outputs
shell: bash
run: |
id=${{ matrix.config.id }}
output=${{ matrix.config.id == 1 &&
steps.feed-mapping.outputs.addition ||
steps.set-lexering.outputs.multiplication }}
echo "output_${id}=${output}" >> "${GITHUB_OUTPUT}"
outputs:
# ♻️ Simulate Gell-Mann Matrices
target: ${{ steps.gen_outputs.outputs.output_1 }}
address: ${{ steps.gen_outputs.outputs.output_2 }}
function: ${{ steps.set-lexering.outputs.function }}
parsering:
needs: lexering
continue-on-error: false
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- { os: self-hosted, id: 3 }
- { os: windows-latest, id: 4 }
# 💢 Completeness relations
max-parallel: ${{ contains(needs.*.result, 'success') && 1 || 2 }}
fail-fast: ${{ contains(needs.*.result, 'success') && false || true }}
env:
IP_ADDRESS: '${{ needs.lexering.outputs.address }}'
PASS: ${{ contains(needs.*.result, 'success') && true || false }}
# ✔️ Completeness status
if: ${{ (always() && contains(needs.*.result, 'success')) ||
(failure() && contains(needs.*.result, 'failure')) }}
steps:
- name: 📂 Checkout
uses: actions/checkout@v4
with:
ref: 'gh-source'
submodules: recursive
token: ${{ secrets.ACCESS_TOKEN }}
repository: ${{ env.TARGET_REPOSITORY }}
- name: 🚀 Setup Parser
if: ${{ env.PASS == 'true' }}
uses: eq19/parser@v2
id: set-parser
with:
id: ${{ matrix.config.id }}
token: ${{ secrets.ACCESS_TOKEN }}
credentials: ${{ secrets.GCP_CREDENTIALS }}
pauli_sum: ${{ needs.lexering.outputs.function }}
failure_status: ${{ contains(steps.*.conclusion, 'failure') ||
(matrix.config.id == 4 && contains(needs.*.result, 'failure')) }}
- name: 🌀 Evaluate Syntax
if: ${{ env.PASS == 'true' }}
uses: eq19/syntax@v2
id: eval-syntax
with:
id: ${{ matrix.config.id }}
token: ${{ secrets.ACCESS_TOKEN }}
credentials: ${{ secrets.GCP_CREDENTIALS }}
pauli_sum: ${{ toJSON(steps.set-parser.outputs) }}
failure_status: ${{ contains(steps.*.conclusion, 'failure') ||
(matrix.config.id == 4 && contains(needs.*.result, 'failure')) }}
- name: ⚧️ Set Grammar Rules
uses: eq19/grammar@v1
id: grammar-rules
if: always()
with:
id: ${{ matrix.config.id }}
token: ${{ secrets.ACCESS_TOKEN }}
credentials: ${{ secrets.GCP_CREDENTIALS }}
pauli_sum: ${{ toJSON(steps.eval-syntax.outputs) }}
failure_status: ${{ contains(steps.*.conclusion, 'failure') ||
(matrix.config.id == 4 && contains(needs.*.result, 'failure')) }}