Lexer bug fix: Only register elif/else/fi as keywords if they're lvalues #507
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: Test Compiler And Deploy Site | |
| on: | |
| # Runs on pushes targeting the default branch | |
| push: | |
| branches: ["main"] | |
| paths: | |
| - "wiki/**" | |
| - "src/**" | |
| - "test-suite/**" | |
| - "vscode/syntaxes/**" | |
| - "makefile" | |
| - "Doxyfile" | |
| - ".github/workflows/jekyll-gh-pages.yml" | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| # Build job | |
| build: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: debian:stable | |
| options: --user root | |
| if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} # Conditional check to ensure the job only runs on GitHub Actions | |
| steps: | |
| - name: Set up Git | |
| run: | | |
| apt-get update | |
| apt-get install git git-lfs -y | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| lfs: true | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: "18" | |
| - name: Install Node.js dependencies | |
| run: | | |
| cd wiki/_includes/code | |
| npm install vscode-textmate vscode-oniguruma | |
| - name: Run Node.js Code Highlighter | |
| run: | | |
| cd wiki/_includes/code | |
| bash ./colorize-all.sh | |
| - name: Check if source or tests have changed | |
| id: code_changed | |
| uses: dorny/paths-filter@v2 | |
| with: | |
| filters: | | |
| code: | |
| - 'src/**' | |
| - 'stdlib/**' | |
| - 'test-suite/**' | |
| - '.github/workflows/jekyll-gh-pages.yml' | |
| - 'makefile' | |
| - 'mk/**' | |
| - 'Doxyfile' | |
| - name: Install build dependencies | |
| if: steps.code_changed.outputs.code == 'true' | |
| run: | | |
| apt-get update | |
| apt-get install build-essential flex bison doxygen graphviz libfrozen-dev libutfcpp-dev -y | |
| - name: Run tests and generate test stats SVG | |
| if: steps.code_changed.outputs.code == 'true' | |
| run: | | |
| apt-get install bc -y | |
| bash wiki/_includes/code/run-tests.sh | |
| - name: Preserve old test stats SVG | |
| if: steps.code_changed.outputs.code == 'false' | |
| run: | | |
| apt-get install curl -y | |
| curl -o wiki/test-results.svg https://bpp.sh/test-results.svg | |
| curl -o wiki/badge.svg https://bpp.sh/badge.svg | |
| - name: Generate STL documentation | |
| if: steps.code_changed.outputs.code == 'true' | |
| run: | | |
| git clone https://github.com/rail5/autodoc-bpp.git autodoc-bpp | |
| # Generate the docs with autodoc-bpp | |
| bin/bpp -I$(pwd)/stdlib/ autodoc-bpp/autodoc.bpp -d "$(pwd)/stdlib/" -o "wiki/stl/" -m md | |
| # Create copies for each of these to preserve their sources | |
| for file in wiki/stl/*.md; do | |
| if [[ $(basename $file) == "index.md" ]]; then | |
| continue | |
| fi | |
| # Note: Jekyll strips leading front-matter from published output | |
| # regardless of the file extension | |
| # So here's a hack for you: | |
| # We'll wrap the source in a small front-matter header | |
| # to be consumed by Jekyll, | |
| # leaving the *real* front-matter intact in the .source.txt file | |
| fileName="wiki/stl/$(basename $file .md).source.txt" | |
| cp "$file" "$fileName" | |
| # Now prepend the front-matter header to the original file | |
| sed -i '1s;^;---\nlayout: null\n---\n;' "$fileName" | |
| done | |
| # These copies will be used in later runs to preserve the old documentation if we don't need to regenerate it | |
| shell: bash | |
| - name: Preserve old STL documentation | |
| if: steps.code_changed.outputs.code == 'false' | |
| run: | | |
| apt-get install curl -y | |
| links=$(curl -s https://bpp.sh/stl/index.html | grep -oP 'href=".*?stl/.*"' | sed 's/href="//' | sed 's/"//') | |
| for link in $links; do | |
| # If the link does not end in .html, skip it | |
| if [[ $link != *.html ]]; then | |
| continue | |
| fi | |
| echo "Found $link" | |
| echo "Downloading https://bpp.sh/stl/$(basename $link .html).source.txt --> wiki/stl/$(basename $link .html).md" | |
| curl -o "wiki/stl/$(basename $link .html).md" "https://bpp.sh/stl/$(basename $link .html).source.txt" | |
| for file in wiki/stl/*.md; do | |
| cp "$file" wiki/stl/$(basename $file .md).source.txt | |
| done | |
| done | |
| shell: bash | |
| - name: Generate Doxygen internal technical documentation | |
| if: steps.code_changed.outputs.code == 'true' | |
| run: | | |
| doxygen Doxyfile | |
| # Copy the generated documentation to the wiki | |
| mkdir -p wiki/doxygen | |
| cp -r docs/html/* wiki/doxygen/ | |
| - name: Preserve old Doxygen internal technical documentation | |
| if: steps.code_changed.outputs.code == 'false' | |
| run: | | |
| # Download the old documentation from the website | |
| apt-get install wget -y | |
| mkdir -p wiki/doxygen | |
| wget -mpEk https://bpp.sh/doxygen/ | |
| cp -r bpp.sh/doxygen/* wiki/doxygen/ | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v3 | |
| - name: Build with Jekyll | |
| uses: actions/jekyll-build-pages@v1 | |
| with: | |
| source: ./wiki/ | |
| destination: ./_site | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| # Deployment job | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |