Skip to content

Commit c0b6714

Browse files
committed
update workflows
1 parent eb45061 commit c0b6714

File tree

16 files changed

+346
-215
lines changed

16 files changed

+346
-215
lines changed

.github/actions/1-addition/1-maps/action.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ runs:
119119
gh api --method DELETE -H "${HEADER}" /repos/${{ github.repository }}/actions/runners/${RUNNER_ID}
120120
fi
121121
122-
/home/runner/work/_actions/eq19/eq19/v2/.github/entrypoint/init.sh ${{ inputs.action_path }}
122+
bash /home/runner/work/_actions/eq19/eq19/v2/.github/entrypoint/init.sh ${{ inputs.action_path }}
123123
mv -f /home/runner/work/_actions/eq19/eq19/v2/.github/entrypoint/dockerfile/* ${{ inputs.action_path }}/
124124
125125
- name: View context attributes
@@ -137,6 +137,15 @@ runs:
137137
#path: ~/.cache/pip
138138
#key: ${{ runner.os }}-pip
139139

140+
- name: 💎 Set ID Token
141+
id: 'auth'
142+
uses: 'google-github-actions/auth@v2'
143+
with:
144+
token_format: 'id_token'
145+
create_credentials_file: false
146+
credentials_json: ${{ inputs.credentials }}
147+
id_token_audience: 'https://us-central1-feedmapping.cloudfunctions.net/function'
148+
140149
- name: Install dependencies
141150
shell: bash
142151
env:
@@ -166,6 +175,7 @@ runs:
166175

167176
##Ref: https://github.com/tsoding/JelloVM
168177
#cd ${{ inputs.action_path }} && javac javaCode/Main.java
178+
python user_data/ft_client/test_client/app.py output.txt
169179

170180
##Ref: https://github.com/eq19/maps/tree/v3/pythonCode
171181
##python ${{ github.workspace }}/.github/entrypoint/artifact/python/gellmann.py
@@ -180,12 +190,22 @@ runs:
180190
- name: 🚀 Initiate Lexer
181191
uses: devcontainers/[email protected]
182192
with:
183-
runCmd: ls -al /
184193
skipContainerUserIdUpdate: true
185194
imageName: ${{ inputs.image_name }}
186195
imageTag: target-${{ github.run_number }}
187196
configFile: ${{ inputs.action_path }}/.devcontainer.json
188197
push: ${{ env.RERUN_RUNNER == 'true' && 'always' || 'never' }}
198+
runCmd: bash user_data/ft_client/test_client/maps.sh
199+
env: |
200+
ID=${{ env.ID }}
201+
GH_TOKEN=${{ env.GH_TOKEN }}
202+
REMOTE_REPO=${{ env.REMOTE_REPO }}
203+
BEARER=${{ steps.auth.outputs.id_token }}
204+
GITHUB_REPOSITORY=${{ github.repository }}
205+
TARGET_REPOSITORY=${{ env.TARGET_REPOSITORY }}
206+
WORKSPACE=/workspaces/${{ github.event.repository.name }}
207+
OUTPUT=user_data/ft_client/test_client/results/output.txt
208+
ARTIFACT=user_data/ft_client/test_client/results/orgs.json
189209
190210
- name: 🗑️ Delete Docker Tags AND Images
191211
id: delete_images

.github/actions/1-addition/2-feed/action.yml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -93,28 +93,13 @@ outputs:
9393
runs:
9494
using: composite
9595
steps:
96-
- name: 💎 Set ID Token
97-
id: 'auth'
98-
uses: 'google-github-actions/auth@v2'
99-
with:
100-
token_format: 'id_token'
101-
create_credentials_file: false
102-
credentials_json: ${{ inputs.credentials }}
103-
id_token_audience: 'https://us-central1-feedmapping.cloudfunctions.net/function'
104-
10596
- name: 💎 Set Artifact
10697
id: artifact
10798
shell: bash
10899
run: |
109100
shopt -s dotglob
110101
rm -rf ${{ inputs.action_path }}/.git
111102
112-
mv -f ${{ runner.temp }}/.env ${{ inputs.action_path }}/
113-
mv -f ${{ runner.temp }}/_config.yml ${{ inputs.action_path }}/
114-
115-
mkdir -p ${{ inputs.action_path }}/_data
116-
mv -f ${{ runner.temp }}/*.json ${{ inputs.action_path }}/_data/
117-
118103
mv -f ${{ inputs.action_path }} ${{ github.workspace }}/_site
119104
mkdir -p ${{ inputs.action_path }} && cp -R ${{ github.workspace }}/_site/. ${{ inputs.action_path }}/
120105
@@ -160,14 +145,14 @@ runs:
160145
skipContainerUserIdUpdate: true
161146
imageName: ${{ inputs.image_name }}
162147
configFile: _site/.devcontainer.json
148+
runCmd: bash user_data/ft_client/test_client/feed.sh
149+
push: ${{ env.RERUN_RUNNER == 'true' && 'always' || 'never' }}
163150
env: |
164151
ID=${{ env.ID }}
165152
GH_TOKEN=${{ env.GH_TOKEN }}
166153
REMOTE_REPO=${{ env.REMOTE_REPO }}
167154
BEARER=${{ steps.auth.outputs.id_token }}
168155
TARGET_REPOSITORY=${{ env.TARGET_REPOSITORY }}
169-
push: ${{ env.RERUN_RUNNER == 'true' && 'always' || 'never' }}
170-
runCmd: bash user_data/ft_client/test_client/test_rest_client.sh
171156
172157
- name: 🪂 Remove existing images
173158
id: variables

.github/actions/1-addition/3-lexer/action.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,24 @@ runs:
8181
- name: 🪂 Adapt feed mapping
8282
shell: bash
8383
run: |
84+
gh variable set ORGS_JSON --body "$(cat $RUNNER_TEMP/orgs.json)"
8485
mv -f .github/entrypoint/dockerfile/* ${{ inputs.action_path }}/
8586
cd ${{ github.workspace }}/_site && rm -rf .git .devcontainer.json Dockerfile*
86-
git clone --single-branch -b gh-pages ${REMOTE_REPO} ${{ inputs.action_path }}/_site &>/dev/null
87+
#git clone --single-branch -b gh-pages ${REMOTE_REPO} ${{ inputs.action_path }}/_site &>/dev/null
8788
88-
cd ${{ inputs.action_path }}/_site
89-
shopt -s dotglob && rm -rf ${RUNNER_TEMP}/*
90-
[[ -d docs ]] && mv -f docs ${RUNNER_TEMP}/
91-
[[ -d .sass-cache ]] && mv -f .sass-cache ${RUNNER_TEMP}/
92-
[[ -f .jekyll-metadata ]] && mv -f .jekyll-metadata ${RUNNER_TEMP}/
89+
#cd ${{ inputs.action_path }}/_site
90+
#shopt -s dotglob && rm -rf ${RUNNER_TEMP}/*
91+
#[[ -d docs ]] && mv -f docs ${RUNNER_TEMP}/
92+
#[[ -d .sass-cache ]] && mv -f .sass-cache ${RUNNER_TEMP}/
93+
#[[ -f .jekyll-metadata ]] && mv -f .jekyll-metadata ${RUNNER_TEMP}/
9394
94-
rm -rf *
95+
#rm -rf *
9596
#git rm -rfq .
9697
#git clean -fxd
97-
mv -f ${RUNNER_TEMP}/* .
98-
mv -f ${{ github.workspace }}/_site/* .
98+
#mv -f ${RUNNER_TEMP}/* .
99+
#mv -f ${{ github.workspace }}/_site/* .
100+
101+
mv -f ${{ github.workspace }}/_site ${{ inputs.action_path }}/
99102
cat ${{ inputs.action_path }}/Dockerfile
100103
101104
- name: 🚀 Initiate Lexer
@@ -104,16 +107,16 @@ runs:
104107
with:
105108
imageTag: id-${{ env.ID }}
106109
skipContainerUserIdUpdate: true
107-
runCmd: ls -alR /home/runner/_site
108110
imageName: ${{ inputs.image_name }}
111+
runCmd: bash user_data/ft_client/test_client/lexer.sh
109112
configFile: ${{ inputs.action_path }}/.devcontainer.json
110113
push: ${{ env.RERUN_RUNNER == 'true' && 'always' || 'never' }}
111114
env: |
112-
CXX=clang++
113-
CC=clang
114-
FC=gfortran
115+
ID=${{ env.ID }}
116+
GH_TOKEN=${{ env.GH_TOKEN }}
117+
REMOTE_REPO=${{ env.REMOTE_REPO }}
118+
BEARER=${{ steps.auth.outputs.id_token }}
115119
TARGET_REPOSITORY=${{ env.TARGET_REPOSITORY }}
116-
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
117120
118121
- name: 💎 Variables
119122
id: variables

.github/actions/2-multiplication/1-maps/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ runs:
111111
- name: 💎 Remove Existing Self-Hosted Runner
112112
shell: bash
113113
run: |
114-
/Users/runner/work/_actions/eq19/eq19/v2/.github/entrypoint/init.sh
114+
bash /Users/runner/work/_actions/eq19/eq19/v2/.github/entrypoint/init.sh
115115
116116
- name: View context attributes
117117
uses: actions/github-script@v7

.github/actions/2-multiplication/2-feed/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,4 +221,4 @@ runs:
221221
--scopes=https://www.googleapis.com/auth/cloud-platform --deletion-protection
222222
--zone=us-central1-a --machine-type=e2-micro --enable-display-device --tags=https-server
223223
--boot-disk-device-name=cos --image-project cos-cloud --image-family cos-stable --metadata-from-file=user-data=cloud-config
224-
--create-disk=boot=no,auto-delete=yes,name=tensorflow,device-name=deeplearning,mode=rw,size=50,type=pd-standard,image=projects/ml-images/global/images/c1-deeplearning-tf-2-11-cu113-v20230925-debian-10-py37
224+
--create-disk=boot=no,auto-delete=yes,name=tensorflow,device-name=deeplearning,mode=rw,size=50,type=pd-standard,image=projects/ml-images/global/images/c0-deeplearning-common-cpu-v20250325-debian-11-py310-conda

.github/actions/3-exponentiation/5-syntax/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ runs:
8383
steps:
8484
#Fill in metadata with ${{ steps.artifact.outputs.orgs_json }}
8585
- name: Run identity
86+
if: runner.os == 'Redis'
8687
shell: bash
8788
run: |
8889
TOKEN=$(/mnt/disks/deeplearning/usr/bin/gcloud auth print-identity-token)

.github/actions/3-exponentiation/6-grammar/action.yml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,9 @@ runs:
8585
run: |
8686
if [[ '${{ inputs.failure_status }}' == 'false' ]]; then
8787
88-
TARGET_WIKI="https://${{ github.actor }}:${{ inputs.token }}@github.com/$TARGET_REPOSITORY.wiki.git"
89-
git clone $TARGET_WIKI ${{ inputs.runner_temp }}/wiki
90-
cd ${{ inputs.runner_temp }}/wiki
91-
cat _Sidebar.md
92-
93-
#ls -alR /home/runner/xml
94-
#ls -alR /home/runner/templates/doxygen/doc
88+
TARGET_WIKI="https://${{ github.actor }}:${{ inputs.token }}@github.com/$TARGET_REPOSITORY.wiki.git"
89+
rm -rf $RUNNER_TEMP/wiki && git clone $TARGET_WIKI $RUNNER_TEMP/wiki
90+
cat $RUNNER_TEMP/wiki/_Sidebar.md
9591
9692
fi
9793

@@ -110,14 +106,7 @@ runs:
110106
111107
else
112108

113-
cd /home/runner/_site && rm -rf .git .github .env .ssh .cache node-modules
114-
115-
cd ${{ github.workspace }}
116-
find -not -path "./.git/*" -not -name ".git" | grep git
117-
find -not -path "./.git/*" -not -name ".git" -delete
118-
shopt -s dotglob && mv -f /home/runner/_site/* .
119-
120-
# Assign the environment variable correctly
109+
# Assign the environment variable correctly
121110
#COMMIT="${{ env.LATEST_COMMIT }}"
122111

123112
# Remove double quotes

.github/actions/4-identition/4-parser/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ runs:
8181
- name: Run identity
8282
shell: bash
8383
run: |
84-
/d/a/_actions/eq19/eq19/v2/.github/entrypoint/init.sh
84+
drive=/$(echo "$GITHUB_WORKSPACE" | cut -c1 | tr '[:upper:]' '[:lower:]')
85+
$drive/a/_actions/eq19/eq19/v2/.github/entrypoint/init.sh
8586
8687
- name: View context attributes
8788
uses: actions/github-script@v7

.github/actions/4-identition/5-syntax/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ runs:
103103
id_token_audience: 'https://us-central1-feedmapping.cloudfunctions.net/function'
104104

105105
#Fill in metadata with ${{ steps.artifact.outputs.orgs_json }}
106-
- name: Run identity
106+
- name: Run identity
107+
if: runner.os != 'Windows'
107108
shell: bash
108109
env:
109110
GCP_TOKEN: ${{ steps.auth.outputs.id_token }}

.github/actions/4-identition/6-grammar/action.yml

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,6 @@ runs:
102102
103103
else
104104

105-
cd ${GITHUB_WORKSPACE//\\//}
106-
107-
echo -e "\n$hr\nConfig\n$hr"
108-
cat _config.yml
109-
110105
echo -e "\n$hr\nSource Pages\n$hr"
111106
rm -rf _user && ls -al .
112107

@@ -134,9 +129,6 @@ runs:
134129
echo "Original: $LATEST_COMMIT"
135130
echo "Processed: $MESSAGE"
136131

137-
# Commit and push changes
138-
git add . && git commit --allow-empty -m "$MESSAGE" && git push
139-
140132
echo -e "\n$hr\nFinal Status\n$hr"
141133
# Fetch all branches
142134
git fetch --all
@@ -174,27 +166,48 @@ runs:
174166
echo "Created v0 branch and set it as default"
175167
fi
176168

177-
if [[ "$TARGET_REPOSITORY" != *"eq19/"* ]]; then
178-
# Unpublish existing GitHub Pages
179-
curl -s -X DELETE \
180-
-H "Authorization: token $GH_TOKEN" \
181-
-H "Accept: application/vnd.github.v3+json" \
182-
https://api.github.com/repos/$TARGET_REPOSITORY/pages > /dev/null
183-
184-
# Disable GitHub Pages
185-
curl -s -X PATCH \
186-
-H "Authorization: token $GH_TOKEN" \
187-
-H "Accept: application/vnd.github.v3+json" \
188-
https://api.github.com/repos/$TARGET_REPOSITORY/pages \
189-
-d '{"build_type":"legacy","source":null}' > /dev/null
190-
191-
# Trigger a dispaches action
169+
AUTH="Authorization: Bearer $GH_TOKEN"
170+
VERSION="X-GitHub-Api-Version: 2022-11-28"
171+
ACCEPT="Accept: application/vnd.github+json"
172+
RESPONSE=$(curl -s -L -H "$AUTH" -H "$VERSION" -H "$ACCEPT" "https://api.github.com/repos/$TARGET_REPOSITORY/actions/runners")
173+
STATUS=$(echo "$RESPONSE" | jq -r --arg NAME "$RUNNER_TITLE" '.runners[] | select(.name == $NAME).status')
174+
175+
if [[ "$STATUS" != "online" ]]; then
176+
192177
curl -s -X POST \
193178
-H "Authorization: token $GH_TOKEN" \
194179
-H "Accept: application/vnd.github.v3+json" \
195-
https://api.github.com/repos/$TARGET_REPOSITORY/dispatches \
196-
-d '{"event_type": "trigger_action", "client_payload": {"env": "prod", "version": "1.0"}}'
197-
echo -e "\nDispatched to https://github.com/${{ env.TARGET_REPOSITORY }}/actions"
198-
fi
180+
"https://api.github.com/repos/$GITHUB_REPOSITORY/dispatches" \
181+
-d '{"event_type": "retry_workflow", "client_payload": {"original_run_id": "$GITHUB_RUN_ID"}}'
182+
echo -e "\nDispatched to https://github.com/${{ env.GITHUB_REPOSITORY }}/actions"
183+
exit 1
199184

185+
else
186+
187+
# Commit and push changes
188+
git add . && git commit --allow-empty -m "$MESSAGE" && git push
189+
190+
if [[ "$TARGET_REPOSITORY" != *"eq19/"* ]]; then
191+
# Unpublish existing GitHub Pages
192+
curl -s -X DELETE \
193+
-H "Authorization: token $GH_TOKEN" \
194+
-H "Accept: application/vnd.github.v3+json" \
195+
https://api.github.com/repos/$TARGET_REPOSITORY/pages > /dev/null
196+
197+
# Disable GitHub Pages
198+
curl -s -X PATCH \
199+
-H "Authorization: token $GH_TOKEN" \
200+
-H "Accept: application/vnd.github.v3+json" \
201+
https://api.github.com/repos/$TARGET_REPOSITORY/pages \
202+
-d '{"build_type":"legacy","source":null}' > /dev/null
203+
204+
# Trigger a dispaches action
205+
curl -s -X POST \
206+
-H "Authorization: token $GH_TOKEN" \
207+
-H "Accept: application/vnd.github.v3+json" \
208+
"https://api.github.com/repos/$TARGET_REPOSITORY/dispatches" \
209+
-d '{"event_type": "trigger_action", "client_payload": {"env": "prod", "version": "1.0"}}'
210+
echo -e "\nDispatched to https://github.com/${{ env.TARGET_REPOSITORY }}/actions"
211+
fi
212+
fi
200213
fi

0 commit comments

Comments
 (0)