Skip to content

Commit

Permalink
ci: test the new prebuilt packages
Browse files Browse the repository at this point in the history
  • Loading branch information
medvednikov committed Nov 29, 2019
1 parent 71378b8 commit 1bfcdaa
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 30 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: CI
on: [push, pull_request]
jobs:

build-alpine-docker-musl-gcc:
alpine-docker-musl-gcc:
name: Alpine/musl
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v1

- name: Build V
uses: spytheman/docker_alpine_v@v5.0
with:
Expand All @@ -20,7 +20,7 @@ jobs:
with:
entrypoint: .github/workflows/alpine.test.sh

build-osx:
macos:
runs-on: macOS-10.14
steps:
- uses: actions/checkout@v1
Expand All @@ -46,7 +46,7 @@ jobs:
git clone --depth 1 https://github.com/vlang/vid.git
cd vid && ../v -o vid .
build-ubuntu:
ubuntu:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
Expand All @@ -68,7 +68,16 @@ jobs:
- name: x64 machine code generation
run: cd examples/x64 && ../../v -x64 hello_world.v && ./hello_world

build-ubuntu-tcc:
ubuntu-prebuilt:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Download V
run: wget https://github.com/vbinaries/vbinaries/releases/download/latest/v_linux.zip
&& unzip v_linux.zip && ./v --version


ubuntu-tcc:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
Expand All @@ -85,7 +94,7 @@ jobs:
./v -o v2 v.v # Make sure vtcc can build itself
./v test v
build-ubuntu-musl:
ubuntu-musl:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
Expand All @@ -101,7 +110,7 @@ jobs:
# - name: Test v->js
# run: ./v -o hi.js examples/hello_v_js.v && node hi.js

build-windows-gcc:
windows-gcc:
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
Expand All @@ -120,7 +129,7 @@ jobs:
#.\v.exe -o hi.js examples/hello_v_js.v
#node hi.js

build-windows-msvc:
windows-msvc:
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
Expand Down
32 changes: 16 additions & 16 deletions vlib/os/os.v
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ fn vfopen(path, mode string) *C.FILE {
} $else {
return C.fopen(*char(path.str), *char(mode.str))
}
}
}

// read_lines reads the file in `path` into an array of lines.
pub fn read_lines(path string) ?[]string {
Expand Down Expand Up @@ -254,7 +254,7 @@ pub fn read_lines(path string) ?[]string {
fn read_ulines(path string) ?[]ustring {
lines := read_lines(path) or {
return err
}
}
// mut ulines := new_array(0, lines.len, sizeof(ustring))
mut ulines := []ustring
for myline in lines {
Expand All @@ -269,7 +269,7 @@ pub fn open(path string) ?File {
$if windows {
wpath := path.to_wide()
mode := 'rb'
file = File {
file = File {
cfile: C._wfopen(wpath, mode.to_wide())
}
} $else {
Expand All @@ -290,7 +290,7 @@ pub fn create(path string) ?File {
$if windows {
wpath := path.replace('/', '\\').to_wide()
mode := 'wb'
file = File {
file = File {
cfile: C._wfopen(wpath, mode.to_wide())
}
} $else {
Expand All @@ -310,7 +310,7 @@ pub fn open_append(path string) ?File {
$if windows {
wpath := path.replace('/', '\\').to_wide()
mode := 'ab'
file = File {
file = File {
cfile: C._wfopen(wpath, mode.to_wide())
}
} $else {
Expand Down Expand Up @@ -384,7 +384,7 @@ fn posix_wait4_to_exit_status(waitret int) (int,bool) {
if C.WIFEXITED( waitret ) {
ret = C.WEXITSTATUS( waitret )
is_signaled = false
} else if C.WIFSIGNALED( waitret ){
} else if C.WIFSIGNALED( waitret ){
ret = C.WTERMSIG( waitret )
is_signaled = true
}
Expand All @@ -411,10 +411,10 @@ pub:

// `system` works like `exec()`, but only returns a return code.
pub fn system(cmd string) int {
if cmd.contains(';') || cmd.contains('&&') || cmd.contains('||') || cmd.contains('\n') {
//if cmd.contains(';') || cmd.contains('&&') || cmd.contains('||') || cmd.contains('\n') {
// TODO remove panic
panic(';, &&, || and \\n are not allowed in shell commands')
}
//panic(';, &&, || and \\n are not allowed in shell commands')
//}
mut ret := int(0)
$if windows {
// overcome bug in system & _wsystem (cmd) when first char is quote `"`
Expand Down Expand Up @@ -472,7 +472,7 @@ pub fn sigint_to_signal_name(si int) string {
}

// `getenv` returns the value of the environment variable named by the key.
pub fn getenv(key string) string {
pub fn getenv(key string) string {
$if windows {
s := C._wgetenv(key.to_wide())
if s == 0 {
Expand Down Expand Up @@ -503,7 +503,7 @@ pub fn setenv(name string, value string, overwrite bool) int {

pub fn unsetenv(name string) int {
$if windows {
format := '${name}='
format := '${name}='
return C._putenv(format.str)
} $else {
return C.unsetenv(name.str)
Expand Down Expand Up @@ -535,7 +535,7 @@ pub fn rm(path string) {
// rmdir removes a specified directory.
pub fn rmdir(path string) {
$if !windows {
C.rmdir(path.str)
C.rmdir(path.str)
}
$else {
C.RemoveDirectory(path.to_wide())
Expand Down Expand Up @@ -834,7 +834,7 @@ pub fn chdir(path string) {
}

// getwd returns the absolute path name of the current directory.
pub fn getwd() string {
pub fn getwd() string {
$if windows {
max := 512 // MAX_PATH * sizeof(wchar_t)
buf := &u16(calloc(max*2))
Expand Down Expand Up @@ -864,12 +864,12 @@ pub fn realpath(fpath string) string {
ret = C._fullpath(fullpath, fpath.str, MAX_PATH)
if ret == 0 {
return fpath
}
}
} $else {
ret = C.realpath(fpath.str, fullpath)
if ret == 0 {
return fpath
}
}
}
return string(fullpath)
}
Expand Down Expand Up @@ -1020,4 +1020,4 @@ pub fn tmpdir() string {

pub fn chmod(path string, mode int) {
C.chmod(path.str, mode)
}
}
10 changes: 5 additions & 5 deletions vlib/os/os_nix.v
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub fn init_os_args(argc int, argv &byteptr) []string {
mut args := []string
for i in 0 .. argc {
args << string(argv[i])
}
}
return args
}

Expand Down Expand Up @@ -50,7 +50,7 @@ pub fn dir_exists(path string) bool {
/*
$if linux {
C.syscall(4, path.str) // sys_newstat
}
}
*/
dir := C.opendir(path.str)
res := !isnil(dir)
Expand All @@ -73,9 +73,9 @@ pub fn mkdir(path string) ?bool {

// exec starts the specified command, waits for it to complete, and returns its output.
pub fn exec(cmd string) ?Result {
if cmd.contains(';') || cmd.contains('&&') || cmd.contains('||') || cmd.contains('\n') {
return error(';, &&, || and \\n are not allowed in shell commands')
}
//if cmd.contains(';') || cmd.contains('&&') || cmd.contains('||') || cmd.contains('\n') {
//return error(';, &&, || and \\n are not allowed in shell commands')
//}
pcmd := '$cmd 2>&1'
f := vpopen(pcmd)
if isnil(f) {
Expand Down

0 comments on commit 1bfcdaa

Please sign in to comment.