forked from derogold/turtlecoin-crypto
-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (108 loc) · 3.44 KB
/
ci.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
name: CI Build Tests
on:
push:
pull_request:
release:
types: [published]
jobs:
cpp_build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: ${{ matrix.os }} - C++ Test
env:
MSBUILD_PATH: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/MSBuild/Current/Bin"
steps:
- uses: actions/checkout@v1
- name: Create Build Directory
run: mkdir build
- name: Install Dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install -y gcc-8 g++-8
- name: Install Dependencies (OSX)
if: matrix.os == 'macos-latest'
run: |
brew cask uninstall --force oclint || true
brew install llvm || brew upgrade llvm
- name: Execute CMake Process (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
export CC=gcc-8
export CXX=g++-8
cd build
cmake ..
- name: Execute CMake Process (OSX)
if: matrix.os == 'macos-latest'
run: |
export CC=/usr/local/opt/llvm/bin/clang
export CXX=/usr/local/opt/llvm/bin/clang++
cd build
cmake ..
- name: Execute CMake Process (Windows)
if: matrix.os == 'windows-latest'
run: |
cd build
cmake -G "Visual Studio 16 2019" -A x64 ..
- name: Build Project (Linux & OSX)
if: matrix.os != 'windows-latest'
run: |
cd build
make
- name: Build Project (Windows)
if: matrix.os == 'windows-latest'
run: |
$env:PATH = "$env:PATH;$env:MSBUILD_PATH"
cd build
MSBuild turtlecoin-crypto.sln /p:Configuration=Release /m
- name: Test Cryptography (Linux & OSX)
if: matrix.os != 'windows-latest'
run: |
cd build
./cryptotest
- name: Test Cryptography (Windows)
if: matrix.os == 'windows-latest'
run: |
cd build/Release
./cryptotest.exe
node_build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: ['8', '10', '11', '12', '13']
name: ${{ matrix.os }} - Node ${{ matrix.node }} Test
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
name: Set up Node
with:
node-version: ${{ matrix.node }}
registry-url: 'https://registry.npmjs.org'
- name: Install Windows Node.js Build Tools
if: matrix.os == 'windows-latest'
run: npm install -g windows-build-tools --vs2015
- name: Install Dependencies
run: npm install
- name: Check Typescript Style
run: npm run style
- name: Compile Typescript
run: npm run build-typescript
- name: Build JS/WASM Module
run: npm run build-native
- name: Execute C++ Unit Tests
run: npm run test-node
- name: Execute JS/WASM Unit Tests
run: npm run test-js
- name: Generate Prebuilds
if: matrix.node == '12' && github.event_name == 'release' && matrix.os != 'windows-latest' && github.repository == 'turtlecoin/turtlecoin-crypto'
run: |
npm install -g prebuild
prebuild --all --strip -u ${{ secrets.GITHUB_TOKEN }}
- name: Publish to NPM
if: matrix.node == '12' && matrix.os == 'ubuntu-latest' && github.event_name == 'release' && github.repository == 'turtlecoin/turtlecoin-crypto'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish