2023-02-26 17:49:20 +00:00
|
|
|
# This workflow uses actions that are not certified by GitHub.
|
|
|
|
# They are provided by a third-party and are governed by
|
|
|
|
# separate terms of service, privacy policy, and support
|
|
|
|
# documentation.
|
|
|
|
name: D
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ "vardec_varass_dependency" ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ "vardec_varass_dependency" ]
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
jobs:
|
2023-03-26 11:52:55 +01:00
|
|
|
build:
|
2023-03-26 11:39:30 +01:00
|
|
|
name: Build
|
2023-03-25 20:59:22 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-03-26 11:52:55 +01:00
|
|
|
os: [ubuntu-latest]
|
2023-03-25 21:01:02 +00:00
|
|
|
dc: [dmd-2.101.0]
|
2023-03-25 20:59:22 +00:00
|
|
|
exclude:
|
|
|
|
- { os: macOS-latest, dc: dmd-2.085.0 }
|
2023-02-26 17:49:20 +00:00
|
|
|
|
2023-03-25 20:59:22 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2023-02-26 17:49:20 +00:00
|
|
|
steps:
|
2023-03-25 20:59:22 +00:00
|
|
|
- uses: actions/checkout@v2
|
2023-03-26 11:47:56 +01:00
|
|
|
|
2023-03-26 11:43:17 +01:00
|
|
|
|
2023-03-25 20:59:22 +00:00
|
|
|
- name: Install D compiler
|
|
|
|
uses: dlang-community/setup-dlang@v1
|
|
|
|
with:
|
|
|
|
compiler: ${{ matrix.dc }}
|
2023-02-26 17:49:20 +00:00
|
|
|
|
2023-03-26 11:46:05 +01:00
|
|
|
- name: Build
|
|
|
|
run: dub build
|
|
|
|
|
2023-03-26 11:58:47 +01:00
|
|
|
|
2023-03-26 11:57:38 +01:00
|
|
|
|
2023-03-26 11:47:56 +01:00
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: tbin
|
|
|
|
path: tlang
|
2023-03-26 12:21:30 +01:00
|
|
|
|
|
|
|
unittests:
|
|
|
|
needs: build
|
|
|
|
name: Unit tests
|
2023-03-26 12:23:16 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest]
|
|
|
|
dc: [dmd-2.101.0]
|
|
|
|
exclude:
|
|
|
|
- { os: macOS-latest, dc: dmd-2.085.0 }
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-03-26 12:21:30 +01:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2023-03-26 12:23:16 +01:00
|
|
|
- name: Install D compiler
|
|
|
|
uses: dlang-community/setup-dlang@v1
|
2023-03-26 12:21:30 +01:00
|
|
|
with:
|
2023-03-26 12:23:16 +01:00
|
|
|
compiler: ${{ matrix.dc }}
|
2023-03-26 12:21:30 +01:00
|
|
|
|
|
|
|
- name: DUB unit tests with coverage
|
|
|
|
run: dub test --coverage
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: coverage files
|
|
|
|
path: \*.lst
|
|
|
|
|
2023-03-26 12:45:30 +01:00
|
|
|
syntaxcheck:
|
|
|
|
needs: [build, unittests]
|
|
|
|
name: Syntax checking (fine typecheck home)
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Download tlang compiler
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: tbin
|
|
|
|
|
|
|
|
- name: Chmod compiler
|
|
|
|
run: chmod +x tlang
|
|
|
|
# TODO: Maybe check below and make them typeheck again
|
|
|
|
- name: Simple float constant
|
|
|
|
run: ./tlang syntaxcheck source/tlang/testing/typecheck/simple_float_constant.t
|
|
|
|
- name: Simple float constant bad
|
2023-04-12 10:38:26 +01:00
|
|
|
run: |
|
|
|
|
set +e
|
|
|
|
./tlang syntaxcheck source/tlang/testing/typecheck/simple_float_constant_bad.t
|
|
|
|
if [ $? = 255 ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-03-26 12:45:30 +01:00
|
|
|
- name: Simple string
|
|
|
|
run: ./tlang syntaxcheck source/tlang/testing/typecheck/simple_string.t
|
|
|
|
|
2023-03-26 12:15:43 +01:00
|
|
|
typecheck:
|
2023-03-26 12:22:11 +01:00
|
|
|
needs: [build, unittests]
|
2023-03-26 12:15:43 +01:00
|
|
|
name: Typechecking tests
|
2023-03-26 11:52:55 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-03-26 12:02:30 +01:00
|
|
|
- uses: actions/checkout@v2
|
2023-03-26 12:37:10 +01:00
|
|
|
- name: Download tlang compiler
|
2023-03-26 11:52:55 +01:00
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: tbin
|
2023-03-26 11:47:56 +01:00
|
|
|
|
2023-03-26 11:58:47 +01:00
|
|
|
- name: Chmod compiler
|
|
|
|
run: chmod +x tlang
|
|
|
|
|
|
|
|
|
2023-03-26 12:01:07 +01:00
|
|
|
- name: Simple function call
|
|
|
|
run: ./tlang typecheck source/tlang/testing/typecheck/simple_function_call.t
|
2023-04-12 08:31:10 +01:00
|
|
|
- name: Simple function call 1 (type mismatch)
|
2023-04-12 08:42:44 +01:00
|
|
|
run: |
|
|
|
|
set +e
|
|
|
|
./tlang typecheck source/tlang/testing/typecheck/simple_function_call_1.t
|
|
|
|
if [ $? = 255 ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-03-26 12:41:22 +01:00
|
|
|
|
2023-03-26 12:12:12 +01:00
|
|
|
|
2023-03-26 12:09:49 +01:00
|
|
|
- name: Collide container module1
|
2023-04-12 08:49:08 +01:00
|
|
|
run: |
|
|
|
|
set +e
|
|
|
|
./tlang typecheck source/tlang/testing/collide_container_module1.t
|
|
|
|
if [ $? = 255 ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-03-26 12:09:49 +01:00
|
|
|
- name: Collide container module2
|
2023-04-12 08:49:08 +01:00
|
|
|
run: |
|
|
|
|
set +e
|
|
|
|
./tlang typecheck source/tlang/testing/collide_container_module2.t
|
|
|
|
if [ $? = 255 ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-03-26 12:12:12 +01:00
|
|
|
- name: Collide container non-module
|
2023-04-12 08:49:08 +01:00
|
|
|
run: |
|
|
|
|
set +e
|
|
|
|
./tlang typecheck source/tlang/testing/collide_container_non_module.t
|
|
|
|
if [ $? = 255 ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-03-26 12:12:12 +01:00
|
|
|
- name: Collide container
|
2023-04-12 08:49:08 +01:00
|
|
|
run: |
|
|
|
|
set +e
|
|
|
|
./tlang typecheck source/tlang/testing/collide_container.t
|
|
|
|
if [ $? = 255 ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-03-26 12:12:12 +01:00
|
|
|
- name: Collide member
|
2023-04-12 08:49:08 +01:00
|
|
|
run: |
|
|
|
|
set +e
|
|
|
|
./tlang typecheck source/tlang/testing/collide_member.t
|
|
|
|
if [ $? = 255 ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-03-26 12:15:43 +01:00
|
|
|
- name: Precedence collision test
|
2023-04-12 08:49:08 +01:00
|
|
|
run: |
|
|
|
|
set +e
|
|
|
|
./tlang typecheck source/tlang/testing/precedence_collision_test.t
|
|
|
|
if [ $? = 255 ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-03-26 12:09:49 +01:00
|
|
|
|
2023-03-26 12:15:43 +01:00
|
|
|
- name: Else if without if
|
2023-04-12 08:51:40 +01:00
|
|
|
run: |
|
|
|
|
set +e
|
|
|
|
./tlang typecheck source/tlang/testing/else_if_without_if.pl
|
|
|
|
if [ $? = 255 ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-03-26 12:15:43 +01:00
|
|
|
- name: Simple module positive
|
|
|
|
run: ./tlang typecheck source/tlang/testing/simple1_module_positive.t
|
2023-04-12 08:55:12 +01:00
|
|
|
# TODO: Re-enable OOP when we start focusing on it again
|
|
|
|
#- name: Simple OOP
|
|
|
|
# run: ./tlang typecheck source/tlang/testing/simple1_oop.t
|
2023-03-26 12:15:43 +01:00
|
|
|
- name: Simple name recognition
|
|
|
|
run: ./tlang typecheck source/tlang/testing/simple2_name_recognition.t
|
2023-04-12 08:57:13 +01:00
|
|
|
# TODO: Re-enable OOP when we start focusing on it again
|
|
|
|
#- name: test3
|
|
|
|
# run: ./tlang typecheck source/tlang/testing/test3.t
|
2023-03-26 12:12:12 +01:00
|
|
|
|
2023-03-26 12:32:22 +01:00
|
|
|
- name: Simple literals
|
|
|
|
run: ./tlang typecheck source/tlang/testing/simple_literals.t
|
2023-04-12 10:33:34 +01:00
|
|
|
- name: Simple literals 2 (uncoercible)
|
|
|
|
run: |
|
2023-04-12 10:36:31 +01:00
|
|
|
set +e
|
2023-04-12 10:33:34 +01:00
|
|
|
./tlang typecheck source/tlang/testing/simple_literals2.t
|
|
|
|
if [ $? = 255 ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-03-26 12:32:22 +01:00
|
|
|
- name: Simple literals 3
|
|
|
|
run: ./tlang typecheck source/tlang/testing/simple_literals3.t
|
2023-04-12 10:42:21 +01:00
|
|
|
- name: Simple literals 4 (range violation)
|
|
|
|
run:
|
|
|
|
set +e
|
|
|
|
./tlang typecheck source/tlang/testing/simple_literals4.t
|
|
|
|
if [ $? = 255 ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-03-26 12:32:22 +01:00
|
|
|
- name: Simple literals 5
|
|
|
|
run: ./tlang typecheck source/tlang/testing/simple_literals5.t
|
|
|
|
- name: Simple literals 6
|
|
|
|
run: ./tlang typecheck source/tlang/testing/simple_literals6.t
|
|
|
|
|
2023-03-26 12:18:50 +01:00
|
|
|
emit:
|
2023-03-26 12:23:54 +01:00
|
|
|
needs: [build, unittests]
|
2023-03-26 12:18:50 +01:00
|
|
|
name: Emit tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2023-03-26 12:37:10 +01:00
|
|
|
- name: Download tlang compiler
|
2023-03-26 12:18:50 +01:00
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: tbin
|
|
|
|
|
|
|
|
- name: Chmod compiler
|
|
|
|
run: chmod +x tlang
|
|
|
|
|
|
|
|
- name: Simple functions
|
|
|
|
run: |
|
|
|
|
./tlang compile source/tlang/testing/simple_functions.t
|
|
|
|
./tlang.out
|
2023-04-12 07:59:19 +01:00
|
|
|
# TODO: Re-enable when we support the `discard` keyword again
|
|
|
|
#- name: Simple variables
|
|
|
|
# run: |
|
|
|
|
# ./tlang compile source/tlang/testing/simple_variables.t
|
|
|
|
# ./tlang.out
|
2023-03-26 12:18:50 +01:00
|
|
|
- name: Simple conditions
|
|
|
|
run: |
|
2023-04-12 08:04:11 +01:00
|
|
|
./tlang compile source/tlang/testing/simple_conditionals.t
|
2023-03-26 12:18:50 +01:00
|
|
|
./tlang.out
|
|
|
|
- name: Nested conditionals
|
|
|
|
run: |
|
|
|
|
./tlang compile source/tlang/testing/nested_conditionals.t
|
|
|
|
./tlang.out
|
|
|
|
- name: Simple function decls
|
|
|
|
run: |
|
|
|
|
./tlang compile source/tlang/testing/simple_function_decls.t
|
|
|
|
./tlang.out
|
|
|
|
- name: Simple function (only) decls
|
|
|
|
run: |
|
|
|
|
./tlang compile source/tlang/testing/simple_variables_only_decs.t
|
|
|
|
./tlang.out
|
|
|
|
- name: Simple variables decls assignment
|
|
|
|
run: |
|
|
|
|
./tlang compile source/tlang/testing/simple_variables_decls_ass.t
|
|
|
|
./tlang.out
|
|
|
|
- name: Simple while
|
|
|
|
run: |
|
|
|
|
./tlang compile source/tlang/testing/simple_while.t
|
|
|
|
./tlang.out
|
2023-03-26 12:29:36 +01:00
|
|
|
#- name: Simple do-while
|
|
|
|
# run: |
|
|
|
|
# ./tlang compile source/tlang/testing/simple_do_while.t
|
|
|
|
# ./tlang.out
|
2023-03-26 12:27:24 +01:00
|
|
|
- name: Simple for-loops
|
|
|
|
run: |
|
|
|
|
./tlang compile source/tlang/testing/simple_for_loops.t
|
|
|
|
./tlang.out
|
2023-03-26 12:28:56 +01:00
|
|
|
- name: Simple cast
|
|
|
|
run: |
|
|
|
|
./tlang compile source/tlang/testing/simple_cast.t
|
|
|
|
./tlang.out
|
|
|
|
- name: Simple pointer
|
|
|
|
run: |
|
|
|
|
./tlang compile source/tlang/testing/simple_pointer.t
|
|
|
|
./tlang.out
|
2023-04-17 15:50:11 +01:00
|
|
|
- name: Simple pointer cast (little endian)
|
|
|
|
run: |
|
|
|
|
././tlang compile source/tlang/testing/simple_pointer_cast_le.t
|
|
|
|
./tlang.out
|
2023-03-26 12:31:01 +01:00
|
|
|
- name: Simple extern
|
|
|
|
run: |
|
|
|
|
chmod +x extern_test.sh
|
|
|
|
./extern_test.sh
|
2023-04-17 15:50:11 +01:00
|
|
|
- name: Simple pointer (malloc and free)
|
|
|
|
run: |
|
|
|
|
chmod +x malloc_test.sh
|
|
|
|
./malloc_test.sh
|
2023-03-26 12:51:35 +01:00
|
|
|
##################################
|
|
|
|
####### Deployment section #######
|
|
|
|
##################################
|
|
|
|
|
2023-03-26 13:11:43 +01:00
|
|
|
# deploy:
|
|
|
|
# needs: [build, unittests, typecheck, syntaxcheck, emit]
|
|
|
|
# name: Deply alpha build
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
# steps:
|
|
|
|
# - uses: actions/checkout@v2
|
|
|
|
# - name: Download tlang compiler
|
|
|
|
# uses: actions/download-artifact@v3
|
|
|
|
# with:
|
|
|
|
# name: tbin
|
|
|
|
|
|
|
|
# - uses: "marvinpinto/action-automatic-releases@latest"
|
|
|
|
# with:
|
|
|
|
# repo_token: "${{ secrets.YES_TOKEN_DEPLOY }}"
|
|
|
|
# automatic_release_tag: "latest"
|
|
|
|
# prerelease: true
|
|
|
|
# title: "Development Build"
|
|
|
|
# files: |
|
|
|
|
# tbin
|
2023-03-26 12:51:35 +01:00
|
|
|
|
|
|
|
|
2023-03-26 12:28:56 +01:00
|
|
|
|
2023-03-26 12:27:24 +01:00
|
|
|
|