Skip to content

Commit dec4ae0

Browse files
authored
Update main.yml
1 parent 72b8399 commit dec4ae0

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

.github/workflows/main.yml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,39 @@ jobs:
2222

2323
- name: Run Values for encoding
2424
run: |
25-
cat <<EOF > Input.txt
25+
cat <<EOF > encode.txt
2626
encode
2727
Hello World!
2828
EOF
2929
3030
- name: Run Binary Encoder
3131
run: |
32-
python binarypy.py < Input.txt >> encode_output.txt
33-
34-
35-
36-
32+
echo -e " Encode Output:\n" > Test-Run-Result/Result.txt
33+
python binarypy.py < encode.txt | tee encode_output.txt >> Test-Run-Result/Result.txt
34+
35+
- name: Run Values for decoding
36+
run: |
37+
echo "decode" > decode.txt
38+
tail -n 1 encode_output.txt >> decode.txt
39+
cat decode.txt
40+
41+
- name: Run Binary Decoder
42+
run: |
43+
echo -e "\n\nDecode Output:\n" >> Test-Run-Result/Result.txt
44+
python binarypy.py < decode.txt >> Test-Run-Result/Result.txt
45+
46+
- name: Upload Binary Encoder/Decoder Test Run Results to Repo
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: Push Binary Encoder/Decoder Test-Run-Result
50+
path: Test-Run-Result/Result.txt
51+
- name: Push Result.txt to Repo
52+
env:
53+
TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
run: |
55+
git config user.name "github-actions[bot]"
56+
git config user.email "github-actions[bot]@users.noreply.github.com"
57+
git remote set-url origin https://x-access-token:${TOKEN}@github.com/${{ github.repository }}
58+
git add Test-Run-Result/Result.txt
59+
git commit -m "Update Binary Encoder/Decoder output [skip ci]" || echo "No changes to commit"
60+
git push

0 commit comments

Comments
 (0)