-
Notifications
You must be signed in to change notification settings - Fork 3
105 lines (84 loc) · 2.31 KB
/
push.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
name: Test and Report
on:
push:
branches:
- main
# permissions:
# issues: write
jobs:
test-js:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-versioin: '17'
- name: Install dependencies
run: |
cd javascript
npm install
- name: Run tests JS
id: run-tests-js
run: |
cd javascript
npm test
test-zig:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Zig using Snap
run: sudo snap install zig --classic --beta
- name: Run tests Zig
id: run-tests-zig
run: zig test zig/index.zig
create-issue-js:
needs: test-js
name: Create Issue for JS Failure
if: ${{ failure() && needs.test-js.result == 'failure' }}
uses: alex1yaremchuk/first-pull-request/.github/workflows/create-issue.yml@main
with:
label: "javascript"
label_upper: "JAVASCRIPT"
secrets:
FIRST_PR_PAT: ${{ secrets.FIRST_PR_PAT }}
create-issue-zig:
needs: test-zig
name: Create Issue for Zig Failure
if: ${{ failure() && needs.test-zig.result == 'failure' }}
uses: alex1yaremchuk/first-pull-request/.github/workflows/create-issue.yml@main
with:
label: "zig"
label_upper: "ZIG"
secrets:
FIRST_PR_PAT: ${{ secrets.FIRST_PR_PAT }}
zig-build-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: refs/heads/main
- name: Install Zig using Snap
run: |
sudo snap install zig --classic --beta
- name: Config, Prepare branch
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git checkout gh-pages || git checkout -b gh-pages
git merge main --no-edit
- name: Compile to WebAssembly
run: |
zig build
- name: Commit built files to gh-pages
run: |
cp zig-out/bin/index.wasm .
git add index.wasm
git commit --allow-empty -m 'Update built index.wasm file'
git push origin gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}