|
| 1 | +name: ci |
| 2 | +run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: Check out repository code |
| 14 | + uses: actions/checkout@v4 |
| 15 | + - name: Install Node and NPM |
| 16 | + uses: actions/setup-node@v4 |
| 17 | + - name: Install dependencies |
| 18 | + run: npm ci --include=dev # We need devDependencies for npx tree-sitter |
| 19 | + - name: "Generate parser.c's" |
| 20 | + run: "npm run gen" |
| 21 | + - name: "Build parsers" |
| 22 | + run: "npm run build" |
| 23 | + test: |
| 24 | + runs-on: ubuntu-latest |
| 25 | + steps: |
| 26 | + - name: Check out repository code |
| 27 | + uses: actions/checkout@v4 |
| 28 | + - name: Install Node and NPM |
| 29 | + uses: actions/setup-node@v4 |
| 30 | + - name: Install dependencies |
| 31 | + run: npm ci --include=dev # We need devDependencies for npx tree-sitter |
| 32 | + - name: "Test expr" |
| 33 | + if: success() || failure() |
| 34 | + run: "npm run test --workspace=expr" |
| 35 | + - name: "Test core" |
| 36 | + if: success() || failure() |
| 37 | + run: "npm run test --workspace=core" |
| 38 | + - name: "Test html" |
| 39 | + if: success() || failure() |
| 40 | + run: "npm run test --workspace=html" |
| 41 | + - name: "Test udl" |
| 42 | + if: success() || failure() |
| 43 | + run: "npm run test --workspace=udl" |
| 44 | + benchmark: |
| 45 | + name: Benchmark |
| 46 | + runs-on: ubuntu-latest |
| 47 | + steps: |
| 48 | + - name: Check out repository code |
| 49 | + uses: actions/checkout@v4 |
| 50 | + - name: Install Node and NPM |
| 51 | + uses: actions/setup-node@v4 |
| 52 | + - name: Install dependencies |
| 53 | + run: npm ci --include=dev # We need devDependencies for npx tree-sitter |
| 54 | + - name: Configure tree sitter cli for parsing |
| 55 | + run: npx tree-sitter init-config |
| 56 | + - name: Benchmark UDL |
| 57 | + run: ./benches/x.sh 1> "../${{ runner.os }}-benchmark.json" |
| 58 | + working-directory: ./udl |
| 59 | + # Download previous benchmark result from cache (if exists) |
| 60 | + - name: Download previous benchmark data |
| 61 | + if: success() || failure() |
| 62 | + uses: actions/cache/restore@v4 |
| 63 | + with: |
| 64 | + path: ./cache |
| 65 | + key: ${{ runner.os }}-benchmark |
| 66 | + # Run `github-action-benchmark` action |
| 67 | + - name: Store benchmark result |
| 68 | + uses: benchmark-action/github-action-benchmark@v1 |
| 69 | + if: success() || failure() |
| 70 | + with: |
| 71 | + # What benchmark tool the output.txt came from |
| 72 | + tool: 'customSmallerIsBetter' |
| 73 | + github-token: ${{ secrets.KERNEL_BOT_TOKEN }} |
| 74 | + #gh-repository: http://rdp.iscinternal.com:3000/KernelRuntime/tree-sitter-objectscript |
| 75 | + comment-always: true |
| 76 | + #gh-pages-branch: 'main' |
| 77 | + #benchmark-data-dir-path: docs/dev/bench |
| 78 | + # Where the output from the benchmark tool is stored |
| 79 | + output-file-path: "${{ runner.os }}-benchmark.json" |
| 80 | + # Where the previous data file is stored |
| 81 | + external-data-json-path: "./cache/${{ runner.os }}-benchmark.json" |
| 82 | + # Upload the updated cache |
| 83 | + - name: Move new bench mark to cache folder |
| 84 | + run: mkdir -p .cache && mv ${{ runner.os }}-benchmark.json cache/ |
| 85 | + - name: Upload updated benchmarks |
| 86 | + uses: actions/cache/save@v4 |
| 87 | + if: success() || failure() # TODO: Remove this after 1 run? |
| 88 | + with: |
| 89 | + path: | |
| 90 | + cache/${{ runner.os }}-benchmark.json |
| 91 | + key: ${{ runner.os }}-benchmark |
0 commit comments