Skip to content

Commit

Permalink
Workflow action pipelines for Linux, Darwin, and Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Oct 10, 2024
1 parent d4cafa0 commit f504058
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 42 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build_ci_darwin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build CI [Darwin]

on:
push:
branches:
- main

build-darwin:
runs-on: darwin-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Python 3.12 Installation
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Get build dependencies
run: brew install make

- name: Build Zhivo
run: |
python build.py
- name: Build verification
run: |
ls dist -ral
find dist | sort | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"
- name: Run test scripts (x86)
run: |
start=$(date +%s%3N)
./dist/zhivo-darwin-x86_64 ./test/arithmetic.zhv
./dist/zhivo-darwin-x86_64 ./test/array.zhv
./dist/zhivo-darwin-x86_64 ./test/digits.zhv
./dist/zhivo-darwin-x86_64 ./test/error_handling.zhv
./dist/zhivo-darwin-x86_64 ./test/flow.zhv
./dist/zhivo-darwin-x86_64 ./test/func.zhv
./dist/zhivo-darwin-x86_64 ./test/loop.zhv
./dist/zhivo-darwin-x86_64 ./test/parallel.zhv
./dist/zhivo-darwin-x86_64 ./test/regex.zhv
./dist/zhivo-darwin-x86_64 ./test/test.zhv
./dist/zhivo-darwin-x86_64 ./test/types.zhv
end=$(date +%s%3N)
echo "Elapsed time: $((end - start)) ms"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build CI
name: Build CI [Linux]

on:
push:
Expand Down Expand Up @@ -79,44 +79,3 @@ jobs:
run: |
/usr/bin/time -v ./dist/zhivo-linux-x86_64-cuda ./examples/hello.zhv
/usr/bin/time -v ./dist/zhivo-linux-x86_64-cuda ./examples/99-beers.zhv
build-darwin:
runs-on: darwin-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Python 3.12 Installation
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Get build dependencies
run: brew install make

- name: Build Zhivo
run: |
python build.py
- name: Build verification
run: |
ls dist -ral
find dist | sort | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"
- name: Run test scripts (x86)
run: |
start=$(date +%s%3N)
./dist/zhivo-darwin-x86_64 ./test/arithmetic.zhv
./dist/zhivo-darwin-x86_64 ./test/array.zhv
./dist/zhivo-darwin-x86_64 ./test/digits.zhv
./dist/zhivo-darwin-x86_64 ./test/error_handling.zhv
./dist/zhivo-darwin-x86_64 ./test/flow.zhv
./dist/zhivo-darwin-x86_64 ./test/func.zhv
./dist/zhivo-darwin-x86_64 ./test/loop.zhv
./dist/zhivo-darwin-x86_64 ./test/parallel.zhv
./dist/zhivo-darwin-x86_64 ./test/regex.zhv
./dist/zhivo-darwin-x86_64 ./test/test.zhv
./dist/zhivo-darwin-x86_64 ./test/types.zhv
end=$(date +%s%3N)
echo "Elapsed time: $((end - start)) ms"
47 changes: 47 additions & 0 deletions .github/workflows/build_ci_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build CI [Windows]

on:
push:
branches:
- main

build-windows:
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Python 3.12 Installation
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Get build dependencies
run: choco install make -y

- name: Build Zhivo
run: |
python build.py
- name: Build verification
run: |
dir dist
tree dist
- name: Run test scripts (x86)
run: |
start=$((Get-Date).Millisecond)
./dist/zhivo-win-x86_64.exe ./test/arithmetic.zhv
./dist/zhivo-win-x86_64.exe ./test/array.zhv
./dist/zhivo-win-x86_64.exe ./test/digits.zhv
./dist/zhivo-win-x86_64.exe ./test/error_handling.zhv
./dist/zhivo-win-x86_64.exe ./test/flow.zhv
./dist/zhivo-win-x86_64.exe ./test/func.zhv
./dist/zhivo-win-x86_64.exe ./test/loop.zhv
./dist/zhivo-win-x86_64.exe ./test/parallel.zhv
./dist/zhivo-win-x86_64.exe ./test/regex.zhv
./dist/zhivo-win-x86_64.exe ./test/test.zhv
./dist/zhivo-win-x86_64.exe ./test/types.zhv
end=$((Get-Date).Millisecond)
echo "Elapsed time: $((end - start)) ms"

0 comments on commit f504058

Please sign in to comment.