Skip to content

Commit 2306986

Browse files
committed
add github actions
1 parent 0ed53c6 commit 2306986

8 files changed

Lines changed: 231 additions & 0 deletions

File tree

.github/workflows/jsource.yml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: JE
2+
3+
on:
4+
- push
5+
6+
# trigger workflow on file change
7+
#on:
8+
# push:
9+
# paths:
10+
# - 'version.txt'
11+
12+
jobs:
13+
jengine:
14+
name: JE
15+
runs-on: ${{ matrix.os }}
16+
17+
strategy:
18+
matrix:
19+
os: [ubuntu-18.04, macos-10.15, windows-2019]
20+
#os: [ubuntu-18.04]
21+
#os: [macos-10.15]
22+
#os: [windows-2019]
23+
24+
steps:
25+
- name: Check Git repository
26+
uses: actions/checkout@v2
27+
with:
28+
submodules: recursive
29+
30+
- name: Setup Environment (Linux)
31+
if: matrix.os == 'ubuntu-18.04'
32+
run: |
33+
sudo apt-get install -y libedit-dev libncursesw5-dev
34+
35+
- name: Setup Environment (Windows)
36+
if: matrix.os == 'windows-2019'
37+
uses: ilammy/msvc-dev-cmd@v1
38+
with:
39+
arch: amd64
40+
41+
- name: Build JE (Linux)
42+
if: matrix.os == 'ubuntu-18.04'
43+
env:
44+
CC: clang
45+
USE_SLEEF: 1
46+
run: script/buildga.sh linux
47+
48+
- name: Build JE (macOS)
49+
if: matrix.os == 'macos-10.15'
50+
env:
51+
CC: clang
52+
USE_SLEEF: 1
53+
run: script/buildga.sh darwin
54+
55+
- name: Build JE (Windows)
56+
if: matrix.os == 'windows-2019'
57+
shell: cmd
58+
run: script\buildga.cmd
59+
60+
- name: Test JE (Linux)
61+
if: matrix.os == 'ubuntu-18.04'
62+
run: script/testga.sh linux
63+
64+
- name: Test JE (maxOS)
65+
if: matrix.os == 'macos-10.15'
66+
run: script/testga.sh darwin
67+
68+
- name: Test JE (Windows)
69+
if: matrix.os == 'windows-2019'
70+
shell: cmd
71+
run: script\testga.cmd
72+
73+
- name: Compress Files (Linux)
74+
if: matrix.os == 'ubuntu-18.04'
75+
run: |
76+
rm j64/ver.ijs
77+
zip -r l64.zip j64
78+
79+
- name: Compress Files (macOS)
80+
if: matrix.os == 'macos-10.15'
81+
run: |
82+
rm j64/ver.ijs
83+
zip -r m64.zip j64
84+
85+
- name: Compress Files (Windows)
86+
if: matrix.os == 'windows-2019'
87+
shell: pwsh
88+
run: |
89+
del j64\ver.ijs
90+
Compress-Archive j64 w64.zip
91+
92+
- name: Release JE (Linux)
93+
if: matrix.os == 'ubuntu-18.04'
94+
uses: ncipollo/release-action@v1
95+
with:
96+
tag: build
97+
artifacts: "l64.zip"
98+
token: ${{ secrets.GITHUB_TOKEN }}
99+
allowUpdates: true
100+
replacesArtifacts: true
101+
102+
- name: Release JE (macOS)
103+
if: matrix.os == 'macos-10.15'
104+
uses: ncipollo/release-action@v1
105+
with:
106+
tag: build
107+
artifacts: "m64.zip"
108+
token: ${{ secrets.GITHUB_TOKEN }}
109+
allowUpdates: true
110+
replacesArtifacts: true
111+
112+
- name: Release JE (Windows)
113+
if: matrix.os == 'windows-2019'
114+
uses: ncipollo/release-action@v1
115+
with:
116+
tag: build
117+
artifacts: "w64.zip"
118+
token: ${{ secrets.GITHUB_TOKEN }}
119+
allowUpdates: true
120+
replacesArtifacts: true
121+
122+
webhook:
123+
name: Run Webhook
124+
runs-on: ubuntu-18.04
125+
needs: jengine
126+
steps:
127+
- name: update server
128+
uses: distributhor/workflow-webhook@v2
129+
env:
130+
webhook_url: ${{ secrets.WEBHOOK_URL }}
131+
webhook_secret: ${{ secrets.WEBHOOK_SECRET }}
132+
data: '{ "id": "jebuild" }'

script/buildga.cmd

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@rem build windows on github actions
2+
3+
mkdir j64
4+
copy script\ver.ijs j64
5+
6+
copy script\jversion.h jsource\jsrc
7+
cd jsource\makemsvc\jconsole
8+
nmake -f makefile.win CC=clang-cl x64=1 clean
9+
nmake -f makefile.win CC=clang-cl x64=1
10+
cd ..
11+
cd jdll
12+
nmake -f makefile.win CC=clang-cl x64=1 JAVX2=1 USE_OPENMP=1 clean
13+
nmake -f makefile.win CC=clang-cl x64=1 JAVX2=1 USE_OPENMP=1
14+
nmake -f makefile.win CC=clang-cl x64=1 JAVX=1 USE_OPENMP=1 clean
15+
nmake -f makefile.win CC=clang-cl x64=1 JAVX=1 USE_OPENMP=1
16+
nmake -f makefile.win CC=clang-cl x64=1 USE_OPENMP=1 clean
17+
nmake -f makefile.win CC=clang-cl x64=1 USE_OPENMP=1
18+
cd ..
19+
cd tsdll
20+
nmake -f makefile.win CC=clang-cl x64=1 clean
21+
nmake -f makefile.win CC=clang-cl x64=1
22+
cd ..
23+
24+
copy jconsole\jconsole.exe ..\..\j64
25+
copy jdll\*.dll ..\..\j64
26+
copy tsdll\tsdll.dll ..\..\j64

script/buildga.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
#
3+
# build linux/macOS on github actions
4+
#
5+
# argument is linux|darwin
6+
7+
if [ $1 == "linux" ]; then
8+
ext="so"
9+
s() { sed -i "$@"; }
10+
else
11+
ext="dylib"
12+
s() { sed -i "" "$@"; }
13+
fi
14+
15+
cp script/jversion.h jsource/jsrc
16+
s "s/windows/$1/" jsource/jsrc/jversion.h
17+
cat jsource/jsrc/jversion.h
18+
cd jsource/make2
19+
./clean.sh
20+
21+
j64x=j64 ./build_jconsole.sh
22+
j64x=j64 ./build_tsdll.sh
23+
j64x=j64 ./build_libj.sh
24+
./clean.sh
25+
j64x=j64avx ./build_libj.sh
26+
./clean.sh
27+
j64x=j64avx2 ./build_libj.sh
28+
29+
cd ../..
30+
D=j64
31+
mkdir -p $D
32+
cp jsource/bin/$1/j64/* $D
33+
cp jsource/bin/$1/j64avx/libj.$ext $D/libjavx.$ext
34+
cp jsource/bin/$1/j64avx2/libj.$ext $D/libjavx2.$ext
35+
cp script/ver.ijs $D
36+
chmod 644 $D/*
37+
chmod 755 $D/jconsole

script/jversion.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#define jversion "903"
2+
#define jplatform "windows"
3+
#define jtype "beta"
4+
#define jlicense "GPL3"
5+
#define jbuilder "github"

script/testga.cmd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@rem test windows on github actions
2+
3+
cd j64
4+
dir
5+
6+
jconsole -lib j.dll -jprofile ver.ijs
7+
jconsole -lib javx.dll -jprofile ver.ijs
8+
jconsole -lib javx2.dll -jprofile ver.ijs

script/testga.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
#
3+
# test linux/macOS on github actions
4+
#
5+
# argument is linux|darwin
6+
7+
if [ $1 == "linux" ]; then
8+
ext="so"
9+
else
10+
ext="dylib"
11+
fi
12+
13+
cd j64
14+
ls -l
15+
./jconsole -lib libj.$ext -jprofile ver.ijs
16+
./jconsole -lib libjavx.$ext -jprofile ver.ijs
17+
18+
# this failed on macOS - perhaps running avx2 not yet supported?
19+
if [ $1 == "linux" ]; then
20+
./jconsole -lib libjavx2.$ext -jprofile ver.ijs
21+
fi

script/ver.ijs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2!:55 (9!:14'') 1!:2 [2

version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1

0 commit comments

Comments
 (0)