chore: Parse gcc statements in expressions #1744
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build-linux: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install unit tests requirements | |
run: | | |
python3 -m venv .env | |
. .env/bin/activate | |
pip install -r tests/unit_tests/requirements.txt | |
- name: Build | |
run: | | |
. .env/bin/activate | |
cmake . \ | |
-Bbuild \ | |
-DCMAKE_BUILD_TYPE=Release | |
cmake --build build | |
- name: Test | |
working-directory: build | |
run: | | |
ctest --output-on-failure | |
- name: Parse C++ source files (WASI toolchain) | |
run: | | |
for i in src/parser/cxx/*.cc src/lsp/cxx/lsp/*.cc src/frontend/cxx/*.cc; do | |
echo "Parsing $i" | |
./build/src/frontend/cxx \ | |
-I src/parser \ | |
-I src/lsp \ | |
-I build/_deps/fmt-src/include \ | |
-I build/_deps/utfcpp-src/source \ | |
-I build/_deps/flatbuffers-src/include \ | |
-I build/_deps/nlohmann_json-src/include \ | |
-I build/src/parser \ | |
-DCXX_NO_FILESYSTEM \ | |
-DCXX_NO_THREADS \ | |
$i | |
done | |
- name: Parse C++ source files (Linux toolchain) | |
run: | | |
for i in src/parser/cxx/*.cc src/lsp/cxx/lsp/*.cc src/frontend/cxx/*.cc; do | |
echo "Parsing $i" | |
./build/src/frontend/cxx \ | |
-toolchain linux \ | |
-I src/parser \ | |
-I src/lsp \ | |
-I build/_deps/fmt-src/include \ | |
-I build/_deps/utfcpp-src/source \ | |
-I build/_deps/flatbuffers-src/include \ | |
-I build/_deps/nlohmann_json-src/include \ | |
-I build/src/parser \ | |
$i | |
done | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install unit tests requirements | |
run: | | |
pip install -r tests\unit_tests\requirements.txt | |
- name: Build | |
run: | | |
cmake . -Bbuild | |
cmake --build build --config Release | |
- name: Test | |
working-directory: build | |
run: | | |
ctest --verbose -C Release | |
build-emscripten: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup emscripten cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.emscripten-cache | |
key: ${{ runner.os }}-emscripten | |
restore-keys: | | |
${{ runner.os }}-emscripten | |
- name: Install dependenciesch | |
run: | | |
npm ci | |
- name: Prettier | |
run: | | |
npm -w cxx-frontend run prettier | |
- name: Build | |
run: | | |
npm -w cxx-frontend run build | |
npm -w cxx-frontend pack | |
- name: Build Docs | |
working-directory: packages/cxx-frontend | |
run: | | |
npm -w cxx-frontend run docs | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cxx-frontend-dist | |
path: | | |
packages/cxx-frontend/dist/ | |
packages/cxx-frontend/docs/ | |
retention-days: 1 | |
build-macos: | |
runs-on: macos-15 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install unit tests requirements | |
run: | | |
python3 -m venv .env | |
. .env/bin/activate | |
pip install -r tests/unit_tests/requirements.txt | |
- name: Build | |
run: | | |
. .env/bin/activate | |
cmake . \ | |
-Bbuild \ | |
-DCMAKE_BUILD_TYPE=Release | |
cmake --build build | |
- name: Test | |
working-directory: build | |
run: | | |
ctest --verbose | |
- name: Parse C++ source files (macOS toolchain) | |
run: | | |
for i in src/parser/cxx/*.cc src/lsp/cxx/lsp/*.cc src/frontend/cxx/*.cc; do | |
echo "Parsing $i" | |
./build/src/frontend/cxx \ | |
-toolchain macos \ | |
-I src/parser \ | |
-I src/lsp \ | |
-I build/_deps/fmt-src/include \ | |
-I build/_deps/utfcpp-src/source \ | |
-I build/_deps/flatbuffers-src/include \ | |
-I build/_deps/nlohmann_json-src/include \ | |
-I build/src/parser \ | |
$i | |
done | |
build-wasi: | |
runs-on: ubuntu-24.04 | |
env: | |
WASMTIME_VERSION: 25.0.2 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: | | |
npm ci | |
npm run build:wasi | |
- name: Install wasmtime | |
run: | | |
wget -nd -P /tmp/ https://github.com/bytecodealliance/wasmtime/releases/download/v${{ env.WASMTIME_VERSION }}/wasmtime-v${{ env.WASMTIME_VERSION }}-$(uname -m)-linux.tar.xz | |
tar -C /usr/local/bin -xvf /tmp/wasmtime-v${{ env.WASMTIME_VERSION }}-$(uname -m)-linux.tar.xz --strip-components=1 --wildcards 'wasmtime-*-linux/wasmtime' | |
- name: Test | |
run: | | |
wasmtime \ | |
-W threads=y -S threads=y \ | |
--dir ${{github.workspace}}/build.wasi/install::/ \ | |
--dir tests::tests \ | |
${{github.workspace}}/build.wasi/install/usr/bin/cxx.wasm -v tests/manual/source.cc | |
- name: Parse C++ source files (wasmtime runtime) | |
run: | | |
PATH=~/wasmtime-v${{ env.WASMTIME_VERSION }}-x86_64-linux:$PATH | |
for i in src/parser/cxx/*.cc src/lsp/cxx/lsp/*.cc src/frontend/cxx/*.cc; do | |
echo "Parsing $i" | |
wasmtime \ | |
-W threads=y -S threads=y \ | |
--dir=src::/src \ | |
--dir=build.wasi/_deps::/build.wasi/_deps \ | |
--dir=build.wasi/src/parser::build.wasi/src/parser \ | |
--dir=build.wasi/src/lsp::build.wasi/src/lsp \ | |
--dir=build.wasi/install/usr::/usr \ | |
build.wasi/install/usr/bin/cxx.wasm \ | |
-I src/parser \ | |
-I src/lsp \ | |
-I build.wasi/_deps/fmt-src/include \ | |
-I build.wasi/_deps/utfcpp-src/source \ | |
-I build.wasi/_deps/flatbuffers-src/include \ | |
-I build.wasi/_deps/nlohmann_json-src/include \ | |
-I build.wasi/src/parser \ | |
-DCXX_NO_FILESYSTEM \ | |
-DCXX_NO_THREADS \ | |
$i | |
done | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cxx-wasi | |
path: | | |
build.wasi/install/ | |
!build.wasi/install/usr/lib/*.a | |
!build.wasi/install/usr/lib/cmake | |
!build.wasi/install/usr/lib/wasi-sysroot/lib | |
!build.wasi/install/usr/lib/wasi-sysroot/share | |
!build.wasi/install/usr/lib/wasi-sysroot/include/ | |
!build.wasi/install/usr/include/wasm32-wasi-threads | |
!build.wasi/install/usr/include/wasm32-wasip1 | |
!build.wasi/install/usr/include/wasm32-wasip1-threads | |
!build.wasi/install/usr/include/wasm32-wasip2 | |
retention-days: 1 | |
release-please: | |
runs-on: ubuntu-24.04 | |
if: false && github.repository == 'robertoraggi/cplusplus' && github.ref == 'refs/heads/main' | |
steps: | |
- uses: GoogleCloudPlatform/release-please-action@v3 | |
with: | |
token: ${{ secrets.RELEASE_TOKEN }} | |
release-type: node | |
package-name: cplusplus | |
extra-files: | | |
packages/cxx-frontend/package.json | |
templates/cxx-parse/package.json | |
templates/cxx-browser-esm-vite/package.json | |
templates/cxx-parse-esm/package.json | |
build-storybook: | |
runs-on: ubuntu-24.04 | |
needs: build-emscripten | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: cxx-frontend-dist | |
path: packages/cxx-frontend | |
- name: Configure GitHub Pages | |
uses: actions/configure-pages@v5 | |
- name: Build | |
run: | | |
npm ci | |
npm run build:storybook | |
mkdir -p packages/cxx-storybook/storybook-static/docs | |
cp -a packages/cxx-frontend/docs/. packages/cxx-storybook/storybook-static/docs | |
- name: Upload GitHub Pages artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: packages/cxx-storybook/storybook-static | |
deploy-storybook: | |
name: Deploy Storybook | |
if: github.repository == 'robertoraggi/cplusplus' && github.ref == 'refs/heads/main' | |
needs: build-storybook | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |