fix(build): parallel_stl_bench 编译定义加 TARGET 守卫 #41
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: Docs (GitHub Pages) | |
| on: | |
| push: | |
| branches: [master] | |
| paths: | |
| - 'docs/**' | |
| - '.github/workflows/pages.yml' | |
| pull_request: | |
| branches: [master] | |
| paths: | |
| - 'docs/**' | |
| - '.github/workflows/pages.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-deploy: | |
| # Only run on the original repository, not on forks | |
| if: github.repository == 'LessUp/cpp-high-performance-guide' | |
| runs-on: ubuntu-latest | |
| # Bind the github-pages environment only when deploying (push / | |
| # workflow_dispatch); skip it on pull requests, which only build+test. | |
| environment: | |
| name: ${{ github.event_name != 'pull_request' && 'github-pages' || '' }} | |
| url: ${{ steps.deploy.outputs.page_url }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| cache-dependency-path: docs/package-lock.json | |
| - name: Configure GitHub Pages | |
| id: pages | |
| if: github.event_name != 'pull_request' | |
| uses: actions/configure-pages@v5 | |
| - name: Set VitePress base | |
| shell: bash | |
| env: | |
| BASE_PATH: ${{ steps.pages.outputs.base_path }} | |
| run: | | |
| set -euo pipefail | |
| if [[ -z "${BASE_PATH}" ]]; then | |
| base="/cpp-high-performance-guide/" | |
| else | |
| base="${BASE_PATH%/}/" | |
| fi | |
| echo "VITEPRESS_BASE=${base}" >> "$GITHUB_ENV" | |
| - name: Install docs dependencies | |
| working-directory: docs | |
| run: npm ci | |
| - name: Run docs regression tests | |
| working-directory: docs | |
| run: npm test | |
| - name: Build docs | |
| working-directory: docs | |
| run: npm run build:pages | |
| - name: Add .nojekyll | |
| if: github.event_name != 'pull_request' | |
| run: touch docs/.vitepress/dist/.nojekyll | |
| - name: Upload Pages artifact | |
| if: github.event_name != 'pull_request' | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/.vitepress/dist | |
| - name: Deploy to GitHub Pages | |
| if: github.event_name != 'pull_request' | |
| id: deploy | |
| uses: actions/deploy-pages@v4 |