|
| 1 | +name: CI |
| 2 | + |
| 3 | +concurrency: |
| 4 | + group: ci-${{ github.ref }} |
| 5 | + cancel-in-progress: true |
| 6 | +on: |
| 7 | + workflow_dispatch: |
| 8 | + push: |
| 9 | + branches: [main] |
| 10 | + pull_request: |
| 11 | + branches: [main] |
| 12 | + |
| 13 | +jobs: |
| 14 | + build: |
| 15 | + name: Build |
| 16 | + timeout-minutes: 60 |
| 17 | + runs-on: ubuntu-22.04 |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 20 | + - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 |
| 21 | + with: |
| 22 | + node-version: 20.x |
| 23 | + - name: Build |
| 24 | + run: yarn install |
| 25 | + - name: Bundle browser example |
| 26 | + working-directory: examples/workflow-server |
| 27 | + run: yarn bundle:browser |
| 28 | + - name: Check for uncommitted changes in yarn.lock |
| 29 | + run: | |
| 30 | + if git diff --name-only | grep -q "^yarn.lock"; then |
| 31 | + echo "::error::The yarn.lock file has uncommitted changes!" |
| 32 | + exit 1 |
| 33 | + fi |
| 34 | + test: |
| 35 | + name: Test |
| 36 | + timeout-minutes: 60 |
| 37 | + runs-on: ubuntu-22.04 |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 40 | + - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 |
| 41 | + with: |
| 42 | + node-version: 20.x |
| 43 | + - name: Install |
| 44 | + run: | |
| 45 | + yarn install |
| 46 | + - name: Test |
| 47 | + run: | |
| 48 | + yarn test:ci |
| 49 | + - name: Publish Test Report |
| 50 | + uses: ctrf-io/github-test-reporter@646f98cfc16c6f7a0e1f6100cabe2deb95dd2eef # v1.0.22 |
| 51 | + with: |
| 52 | + report-path: 'packages/*/ctrf/*.json' |
| 53 | + summary-report: true |
| 54 | + file-report: true |
| 55 | + if: always() |
| 56 | + lint: |
| 57 | + name: Lint |
| 58 | + timeout-minutes: 60 |
| 59 | + runs-on: ubuntu-22.04 |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 62 | + - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 |
| 63 | + with: |
| 64 | + node-version: 20.x |
| 65 | + - name: Install |
| 66 | + run: | |
| 67 | + yarn install |
| 68 | + - name: Create eslint json report |
| 69 | + run: | |
| 70 | + yarn lint:ci |
| 71 | + - name: Create summary |
| 72 | + if: always() |
| 73 | + run: | |
| 74 | + npm_config_yes=true npx github:10up/eslint-json-to-md#82ff16b --path ./eslint_report.json --output ./eslint_report.md |
| 75 | + cat eslint_report.md >> $GITHUB_STEP_SUMMARY |
| 76 | + coverage: |
| 77 | + name: Coverage |
| 78 | + timeout-minutes: 60 |
| 79 | + runs-on: ubuntu-22.04 |
| 80 | + if: github.ref == 'refs/heads/main' |
| 81 | + steps: |
| 82 | + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 83 | + - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 |
| 84 | + with: |
| 85 | + node-version: 20.x |
| 86 | + - name: Install |
| 87 | + run: | |
| 88 | + yarn install |
| 89 | + - name: Run Coverage Tests |
| 90 | + run: | |
| 91 | + yarn test:coverage:ci |
| 92 | + - name: Upload Coverage Report |
| 93 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 94 | + with: |
| 95 | + name: coverage-report |
| 96 | + path: coverage/ |
| 97 | + if: always() |
0 commit comments