Check CML GitHub Action #1367
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: Check CML GitHub Action | |
| on: | |
| schedule: | |
| - cron: 0 0 * * * | |
| pull_request: {} | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| checks: write | |
| jobs: | |
| verify: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - run: | | |
| npm ci | |
| npm run format | |
| npm run lint | |
| npm run build | |
| git diff --exit-code | |
| test-latest: | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| max-parallel: 1 | |
| matrix: | |
| system: | |
| - ubuntu-latest | |
| - macos-latest | |
| - windows-latest | |
| runs-on: ${{ matrix.system }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: run action with latest | |
| uses: ./ | |
| - name: test | |
| run: cml --version | |
| # cml comment/check create need a write-scoped token, which PRs from forks | |
| # don't get (read-only GITHUB_TOKEN). Run this step only where the token can | |
| # write: same-repo PRs and the scheduled run on the default branch. | |
| - name: test CML | |
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository | |
| env: | |
| REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| echo 'Hello CML from ${{ matrix.system }}!' > report.md | |
| cml comment create report.md | |
| cml check create report.md | |
| test-version: | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| max-parallel: 1 | |
| matrix: | |
| system: | |
| - ubuntu-latest | |
| - macos-latest | |
| - windows-latest | |
| runs-on: ${{ matrix.system }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: run action with latest | |
| uses: ./ | |
| with: | |
| version: v0.15.1 | |
| - name: test CML specific version | |
| run: | | |
| if [ "$(cml --version 2>&1)" != '0.15.1' ]; then | |
| exit 1 | |
| fi | |
| echo OK | |
| test-version-prefix: | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| max-parallel: 1 | |
| matrix: | |
| system: | |
| - ubuntu-latest | |
| - macos-latest | |
| - windows-latest | |
| runs-on: ${{ matrix.system }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: run action with latest | |
| uses: ./ | |
| with: | |
| version: 0.15.1 | |
| - name: test CML specific version | |
| run: | | |
| if [ "$(cml --version 2>&1)" != '0.15.1' ]; then | |
| exit 1 | |
| fi | |
| echo OK |