Enhance concurrency strategy with traits, tests, and documentation #45
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] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| XLINGS_VERSION: v0.4.2 | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential curl | |
| - name: Setup xmake | |
| uses: xmake-io/github-action-setup-xmake@v1 | |
| with: | |
| xmake-version: latest | |
| package-cache: true | |
| - name: Install Xlings | |
| env: | |
| XLINGS_NON_INTERACTIVE: 1 | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| curl -fsSL https://raw.githubusercontent.com/d2learn/xlings/refs/heads/main/tools/other/quick_install.sh | bash -s -- "${XLINGS_VERSION}" | |
| test -x "$HOME/.xlings/subos/current/bin/xlings" | |
| echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH" | |
| "$HOME/.xlings/subos/current/bin/xlings" --version | |
| xmake --version | |
| - name: Install toolchain via Xlings | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| "$HOME/.xlings/subos/current/bin/xlings" install --verbose | |
| which xlings || true | |
| which xmake || true | |
| which gcc || true | |
| which cc || true | |
| xlings --version || true | |
| xmake --version | |
| gcc --version | |
| cc --version | |
| - name: Build | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| xmake f -m release -y -vv | |
| xmake -y -vv -j"$(nproc)" | |
| - name: Test | |
| run: xmake run primitives_test | |
| - name: Run examples | |
| run: xmake run basic | |
| build-macos: | |
| runs-on: macos-15 | |
| timeout-minutes: 20 | |
| 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: Verify toolchain | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| xmake --version | |
| clang --version | |
| xcode-select -p | |
| - name: Build with xmake | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| xmake f -m release -vv -y | |
| xmake -y -vv -j"$(sysctl -n hw.ncpu)" | |
| build-windows: | |
| runs-on: windows-latest | |
| timeout-minutes: 20 | |
| 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: Verify xmake | |
| shell: pwsh | |
| run: | | |
| xmake --version | |
| - name: Build | |
| shell: pwsh | |
| run: | | |
| xmake f -m release -y -vv | |
| xmake -y -vv -j$env:NUMBER_OF_PROCESSORS | |
| - name: Test | |
| shell: pwsh | |
| run: xmake run primitives_test | |
| - name: Run examples | |
| shell: pwsh | |
| run: xmake run basic |