Initial commit #1
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 | ||
| run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 | ||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out repository code | ||
| uses: actions/checkout@v4 | ||
| - name: Install Node and NPM | ||
| uses: actions/setup-node@v4 | ||
| - name: Install dependencies | ||
| run: npm ci --include=dev # We need devDependencies for npx tree-sitter | ||
| - name: "Generate parser.c's" | ||
| run: "npm run gen" | ||
| - name: "Build parsers" | ||
| run: "npm run build" | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out repository code | ||
| uses: actions/checkout@v4 | ||
| - name: Install Node and NPM | ||
| uses: actions/setup-node@v4 | ||
| - name: Install dependencies | ||
| run: npm ci --include=dev # We need devDependencies for npx tree-sitter | ||
| - name: "Test expr" | ||
| if: success() || failure() | ||
| run: "npm run test --workspace=expr" | ||
| - name: "Test core" | ||
| if: success() || failure() | ||
| run: "npm run test --workspace=core" | ||
| - name: "Test html" | ||
| if: success() || failure() | ||
| run: "npm run test --workspace=html" | ||
| - name: "Test udl" | ||
| if: success() || failure() | ||
| run: "npm run test --workspace=udl" | ||
| benchmark: | ||
| name: Benchmark | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out repository code | ||
| uses: actions/checkout@v4 | ||
| - name: Install Node and NPM | ||
| uses: actions/setup-node@v4 | ||
| - name: Install dependencies | ||
| run: npm ci --include=dev # We need devDependencies for npx tree-sitter | ||
| - name: Configure tree sitter cli for parsing | ||
| run: npx tree-sitter init-config | ||
| - name: Benchmark UDL | ||
| run: ./benches/x.sh 1> "../${{ runner.os }}-benchmark.json" | ||
| working-directory: ./udl | ||
| # Download previous benchmark result from cache (if exists) | ||
| - name: Download previous benchmark data | ||
| if: success() || failure() | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: ./cache | ||
| key: ${{ runner.os }}-benchmark | ||
| # Run `github-action-benchmark` action | ||
| - name: Store benchmark result | ||
| uses: benchmark-action/github-action-benchmark@v1 | ||
| if: success() || failure() | ||
| with: | ||
| # What benchmark tool the output.txt came from | ||
| tool: 'customSmallerIsBetter' | ||
| github-token: ${{ secrets.KERNEL_BOT_TOKEN }} | ||
| #gh-repository: http://rdp.iscinternal.com:3000/KernelRuntime/tree-sitter-objectscript | ||
| comment-always: true | ||
| #gh-pages-branch: 'main' | ||
| #benchmark-data-dir-path: docs/dev/bench | ||
| # Where the output from the benchmark tool is stored | ||
| output-file-path: "${{ runner.os }}-benchmark.json" | ||
| # Where the previous data file is stored | ||
| external-data-json-path: "./cache/${{ runner.os }}-benchmark.json" | ||
| # Upload the updated cache | ||
| - name: Move new bench mark to cache folder | ||
| run: mkdir -p .cache && mv ${{ runner.os }}-benchmark.json cache/ | ||
| - name: Upload updated benchmarks | ||
| uses: actions/cache/save@v4 | ||
| if: success() || failure() # TODO: Remove this after 1 run? | ||
| with: | ||
| path: | | ||
| cache/${{ runner.os }}-benchmark.json | ||
| key: ${{ runner.os }}-benchmark | ||