Build with different versions of GCC

pull/151/head
Clément FRÉVILLE 2 years ago
parent 105a98ef22
commit a38feb87f6
Signed by: clement.freville2
GPG Key ID: 732E73BB80FA6076

@ -0,0 +1,35 @@
name: C++ CI
on:
push:
paths:
- 'vm/**'
pull_request:
paths-ignore:
- 'vm/**'
workflow_dispatch:
jobs:
build:
if: github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name
runs-on: ubuntu-latest
strategy:
matrix:
gcc-version: [10, 12]
env:
CC: gcc-${{ matrix.gcc-version }}
CXX: g++-${{ matrix.gcc-version }}
steps:
- uses: actions/checkout@v4
- name: Build Debug
run: |
cd vm
cmake -B build -S .
cmake --build build
- name: Build Release
run: |
cd vm
cmake -DCMAKE_BUILD_TYPE=Release -B build -S .
cmake --build build

@ -17,7 +17,7 @@ jobs:
if: github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1

@ -38,6 +38,7 @@ git switch <your-branch> && git rebase master # Rebase your branch on the latest
We encourage you to keep your pull requests as small as possible. Concise changes have a better chance of being accepted quickly.
When you make a pull request, our CI will build your changes and run them through all the tests and style checks. All of these tests should pass before your pull request can be accepted.
It is configured to run on Linux, with the latest stable version of Rust, GCC 10 and GCC 12.
## Code Guidelines
@ -54,7 +55,7 @@ cargo clippy --tests # Lint the code and tests
The virtual machine is written in C++20, compiled with Clang and GCC. Compiler specific features should be avoided.
It is built using CMake. The code should be formatted using [clang-format](https://clang.llvm.org/docs/ClangFormat.html).
It is built using CMake. The code should be formatted using [clang-format v16](https://clang.llvm.org/docs/ClangFormat.html).
`clang-format` may be run with the following command:
@ -66,7 +67,7 @@ cd vm && make format # Format the code
Changes are expected to be tested. Automated tests are written using the [Rust testing utilities](https://doc.rust-lang.org/book/ch11-00-testing.html) and [lang_tester](https://github.com/softdevteam/lang_tester/) for VM tests.
Add a new test either in the `tests` directory or in the same file as the code it tests.
Add a new test either in the `tests` directory of the crate or in the same file as the code it tests.
If a change breaks other tests, please address them.
Run tests with:

@ -14,6 +14,14 @@ Arithmetic evaluation traditionally needs to be made explicit to be differentiat
Moshell also comes with different data types, such as `Int`, `Float`, `Bool` or `String`. This allows for clearer and more elegant code and avoids arithmetic between incompatible types.
## Installation
Moshell is available from different sources:
- You can download a prebuilt nightly binary with `curl -L https://moshell.dev/setup.sh | sh`.
- If you have a Rust toolchain, CMake and a C++20 compiler installed, you can build a [development version](#build-and-run).
- Docker users can run a prebuilt image with `docker run -it ghcr.io/moshell-lang/moshell:master`.
## Current state
Moshell is a project in its early stages.
@ -53,13 +61,24 @@ Moshell is a project in its early stages.
This repository hosts the source code from the parser to the interpreter.
## Build
## Build and Run
You need a stable Rust compiler to build Moshell frontend on a GNU/Linux system.
The VM needs a C++20 compiler and a CMake installation. Its build script will automatically be called by Cargo.
The MSRV is the latest stable version of Rust.
The VM needs a C++20 compiler and a CMake 3.15+ installation. Its build script will automatically be called by Cargo.
GCC starting from version 10 and Clang starting from version 11 are supported.
```sh
cargo build --release
./target/release/cli # Run the interactive prompt
./target/release/cli -s <file> # Run a file
```
You can export the `MOSHELL_STD` environment variable to specify a path to the standard library.
```sh
export MOSHELL_STD=/path/to/moshell/lib
```
## Examples

Loading…
Cancel
Save