优化模板项目结构,参考 cmdline 项目和 mcpp-style-ref 编码规范 #1
Workflow file for this run
This file contains hidden or 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, master] | |
| pull_request: | |
| branches: [main, master] | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup xmake | |
| uses: xmake-io/github-action-setup-xmake@v1 | |
| with: | |
| xmake-version: latest | |
| package-cache: true | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential | |
| - name: Install Xlings | |
| run: curl -fsSL https://d2learn.org/xlings-install.sh | bash | |
| - name: Install GCC 15.1 with Xlings | |
| run: | | |
| export PATH=/home/xlings/.xlings_data/bin:$PATH | |
| xlings install gcc@15.1 -y | |
| - name: Build | |
| run: | | |
| export PATH=/home/xlings/.xlings_data/bin:$PATH | |
| xmake -y -vv | |
| - name: Test | |
| run: | | |
| export PATH=/home/xlings/.xlings_data/bin:$PATH | |
| xmake run templates_test | |
| - name: Run examples | |
| run: | | |
| export PATH=/home/xlings/.xlings_data/bin:$PATH | |
| xmake run basic | |
| build-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup xmake | |
| uses: xmake-io/github-action-setup-xmake@v1 | |
| with: | |
| xmake-version: latest | |
| package-cache: true | |
| - name: Install LLVM 20 | |
| run: brew install llvm@20 | |
| - name: Build | |
| run: | | |
| xmake f --toolchain=llvm --sdk=/opt/homebrew/opt/llvm@20 | |
| xmake -y -vv | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup xmake | |
| uses: xmake-io/github-action-setup-xmake@v1 | |
| with: | |
| xmake-version: latest | |
| package-cache: true | |
| - name: Build | |
| run: xmake -y -vv | |
| - name: Test | |
| run: xmake run templates_test | |
| - name: Run examples | |
| run: xmake run basic |