Skip to content
26 changes: 14 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: build-cpp

on:
push:
pull_request:

push:
branches: [compile]
pull_request:
branches: [compile]
jobs:
build:
compile:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
Expand All @@ -15,20 +16,21 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install compiler (Linux)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install -y g++
# - name: Install compiler (Linux)
# if: matrix.os == 'ubuntu-latest'
#run: sudo apt-get update && sudo apt-get install -y g++

- name: Compile
run: |
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
g++ cppsp_compiler.cpp -Os -s -std=c++17 -o cppsp_compiler_linux
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
g++ cppsp_compiler.cpp -Os -s -std=c++17 -o cppsp_compiler_linux -static
else
clang++ cppsp_compiler.cpp -Os -s -std=c++17 -o cppsp_compiler_mac
fi
clang++ cppsp_compiler.cpp -Os -std=c++17 -o cppsp_compiler_mac
fi


- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-binary
name: ${{ matrix.os }}-binary
path: cppsp_compiler_*