Set up Go for workflows; fix args in more places

This commit is contained in:
Wilson Lin 2020-07-11 01:33:38 +10:00
parent 89f491c5c3
commit 9faeba3b54
9 changed files with 33 additions and 6 deletions

View File

@ -22,7 +22,8 @@ jobs:
toolchain: stable
profile: minimal
default: true
- uses: actions/setup-go@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '^1.14.0'
- name: Set up Node.js for generating code

View File

@ -42,6 +42,10 @@ jobs:
toolchain: stable
profile: minimal
default: true
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '^1.14.0'
- name: Build CLI
working-directory: ./cli
run: cargo build --release

View File

@ -31,6 +31,10 @@ jobs:
toolchain: stable
profile: minimal
default: true
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '^1.14.0'
- name: Build Java native library
run: cargo build --release
working-directory: ./java

View File

@ -38,6 +38,10 @@ jobs:
toolchain: stable
profile: minimal
default: true
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '^1.14.0'
- name: Build native module
working-directory: ./nodejs
run: |

View File

@ -51,6 +51,10 @@ jobs:
toolchain: stable
profile: minimal
default: true
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '^1.14.0'
- name: Build native module
working-directory: ./python
run: cargo build --release

View File

@ -68,6 +68,10 @@ jobs:
toolchain: stable
profile: minimal
default: true
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '^1.14.0'
- name: Build Ruby native library
shell: bash -l {0}
run: cargo build --release

View File

@ -1,4 +1,4 @@
use hyperbuild::hyperbuild;
use hyperbuild::{Cfg, hyperbuild};
use std::fs;
use std::io::{stdout};
use std::time::Instant;
@ -23,7 +23,9 @@ fn main() {
let start = Instant::now();
for _ in 0..args.iterations {
let mut data = source.to_vec();
hyperbuild(&mut data).unwrap();
hyperbuild(&mut data, &Cfg {
minify_js: false,
}).unwrap();
};
let elapsed = start.elapsed().as_secs_f64();
let ops = args.iterations as f64 / elapsed;

View File

@ -9,7 +9,9 @@ fn main() {
let path_in_catch = path.clone();
let res = panic::catch_unwind(|| {
let mut contents = fs::read(path_in_catch).unwrap();
let _ = hyperbuild::hyperbuild(&mut contents);
let _ = hyperbuild::hyperbuild(&mut contents, &hyperbuild::Cfg {
minify_js: false,
});
});
if res.is_err() {
let contents = fs::read(path).unwrap();

View File

@ -1,9 +1,11 @@
use afl::fuzz;
use hyperbuild::hyperbuild;
use hyperbuild::{Cfg, hyperbuild};
fn main() {
fuzz!(|data: &[u8]| {
let mut mut_data: Vec<u8> = data.iter().map(|x| *x).collect();
let _ = hyperbuild(&mut mut_data);
let _ = hyperbuild(&mut mut_data, &Cfg {
minify_js: false,
});
});
}