📝 update CI

This commit is contained in:
ValKmjolnir 2024-11-21 01:07:52 +08:00
parent 5750a59a45
commit 4e29025f7a
3 changed files with 61 additions and 21 deletions

View File

@ -47,12 +47,12 @@ jobs:
./colgm_test
- name: package
run: |
zip colgm-mac-nightly.zip build/colgm
zip colgm-mac-nightly.zip colgm
zip colgm-mac-nightly.zip colgm.ll
zip -r colgm-mac-nightly.zip bootstrap
zip -r colgm-mac-nightly.zip doc
zip -r colgm-mac-nightly.zip src
zip colgm-macos-aarch64-nightly.zip build/colgm
zip colgm-macos-aarch64-nightly.zip colgm
zip colgm-macos-aarch64-nightly.zip colgm.ll
zip -r colgm-macos-aarch64-nightly.zip bootstrap
zip -r colgm-macos-aarch64-nightly.zip doc
zip -r colgm-macos-aarch64-nightly.zip src
- name: release
uses: softprops/action-gh-release@v2.0.5
with:
@ -61,7 +61,7 @@ jobs:
prerelease: true
draft: false
files: |
colgm-mac-nightly.zip
colgm-macos-aarch64-nightly.zip
linux-x86_64-build-bootstrap:
runs-on: ubuntu-latest
@ -70,9 +70,9 @@ jobs:
uses: actions/checkout@v4
- name: update tag
run: |
git fetch --tags origin
git tag -f linux_nightly
git push -f origin linux_nightly
git fetch --tags origin
git tag -f linux_nightly
git push -f origin linux_nightly
- name: fetch llvm-dev
run: |
sudo apt-get update
@ -125,11 +125,41 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v4
- name: update tag
run: |
git fetch --tags origin
git tag -f windows_nightly
git push -f origin windows_nightly
- name: fetch llvm-dev
run: |
choco install -y llvm
choco install -y zip
clang --version
- name: build
run: |
mkdir build
cd build
cd build
- name: verify
run: |
ls
- name: colgm-build
run: |
ls
- name: std-test
run: |
ls
- name: package
run: |
zip -r colgm-windows-x86_64-nightly.zip bootstrap
zip -r colgm-windows-x86_64-nightly.zip doc
zip -r colgm-windows-x86_64-nightly.zip src
- name: release
uses: softprops/action-gh-release@v2.0.5
with:
name: windows nightly build
tag_name: windows_nightly
prerelease: true
draft: false
files: |
colgm-windows-x86_64-nightly.zip

View File

@ -1,6 +1,7 @@
# <img src="doc/colgm.svg" height="45px"/> Colgm Compiler Project
[![bootstrap](https://github.com/colgm/colgm/actions/workflows/ci.yml/badge.svg)](https://github.com/colgm/colgm/actions/workflows/ci.yml)
[![nightly-build](https://github.com/colgm/colgm/actions/workflows/release.yml/badge.svg)](https://github.com/colgm/colgm/actions/workflows/release.yml)
## Repo Content
@ -10,6 +11,12 @@
## Bootstrap Compiler
- [macos-aarch64-nightly-build](https://github.com/colgm/colgm/releases/tag/macOS_nightly)
- [linux-x86_64-nightly-build](https://github.com/colgm/colgm/releases/tag/linux_nightly)
- [windows-x86_64-nightly-build [WIP]](https://github.com/colgm/colgm/releases/tag/windows_nightly)
Bootstrap compiler locates at `{repo_path}/bootstrap`, written by C++(`-std=c++17`):
Use these commands to build the bootstrap compiler, use `-DCMAKE_BUILD_TYPE=Debug` if want debug version:
@ -67,4 +74,3 @@ See simple tutorial in [bootstrap/README.md](./bootstrap/README.md).
2. llvm debug info, may not support in bootstrap compiler
3. develop bootstrapped compiler
4. array type like `[i32; 128]`
5. support generic type like `A<i32*>` or `A<B<C, D>>` [WIP]

View File

@ -50,10 +50,10 @@ bool type_replace_pass::visit_type_def(type_def* node) {
if (!g_data.types.at(name).generics.empty() &&
node->get_generic_types()) {
err.err(node->get_location(),
err.err(node->get_name()->get_location(),
"replace type \"" + g_data.types.at(name).full_path_name() +
"\" is already a generic type, "
"but more generic types are specified in this node."
"\" is already a generic type, not allowed to replace \"" +
name + "\"."
);
}
if (!g_data.types.at(name).generics.empty() &&
@ -80,7 +80,7 @@ bool type_replace_pass::visit_call_id(ast::call_id* node) {
node->set_redirect_location(ctx.this_file);
if (g_data.types.at(name).pointer_depth) {
err.err(node->get_location(),
err.err(node->get_id()->get_location(),
"replace type \"" + g_data.types.at(name).full_path_name() +
"\" is a pointer type, which is not allowed here."
);
@ -88,10 +88,10 @@ bool type_replace_pass::visit_call_id(ast::call_id* node) {
if (!g_data.types.at(name).generics.empty() &&
node->get_generic_types()) {
err.err(node->get_location(),
err.err(node->get_id()->get_location(),
"replace type \"" + g_data.types.at(name).full_path_name() +
"\" is already a generic type, "
"but more generic types are specified in this node."
"\" is already a generic type, not allowed to replace \"" +
name + "\"."
);
}
if (!g_data.types.at(name).generics.empty() &&
@ -121,7 +121,9 @@ void generic_visitor::scan_generic_type(type_def* type_node) {
return;
}
if (!dm.generic_symbol.count(type_name)) {
rp.report(type_node, "\"" + type_name + "\" is not a generic type.");
rp.report(type_node->get_name(),
"\"" + type_name + "\" is not a generic type."
);
return;
}
@ -240,7 +242,9 @@ bool generic_visitor::visit_call_id(ast::call_id* node) {
return true;
}
if (!dm.generic_symbol.count(type_name)) {
rp.report(node, "\"" + type_name + "\" is not a generic type.");
rp.report(node->get_id(),
"\"" + type_name + "\" is not a generic type."
);
return true;
}