|
9 | 9 | - main |
10 | 10 | pull_request: {} |
11 | 11 |
|
| 12 | +concurrency: |
| 13 | + group: cos-upload-${{ github.repository }}-${{ github.event_name == 'pull_request' && 'pr' || 'production' }} |
| 14 | + cancel-in-progress: false |
| 15 | + |
12 | 16 | jobs: |
13 | 17 | test: |
14 | 18 | runs-on: ubuntu-latest |
@@ -39,37 +43,34 @@ jobs: |
39 | 43 | run: | |
40 | 44 | caps --ci |
41 | 45 | yarn install --immutable |
42 | | - caps verify --toolchain |
43 | 46 |
|
44 | 47 | - name: Validate Calcit snapshot and types |
45 | 48 | run: | |
46 | | - calcit calcit.cirru fix --workflow strict --verify --format edn |
| 49 | + set -euo pipefail |
| 50 | + test ! -e compact.cirru |
| 51 | + test ! -e package.cirru |
47 | 52 | calcit calcit.cirru edit format |
48 | 53 | git diff --exit-code -- calcit.cirru |
49 | 54 | calcit calcit.cirru --check-only |
50 | | - calcit calcit.cirru analyze deprecated --summary-only --format json |
51 | | - calcit calcit.cirru analyze dynamic-methods --summary-only --format json | jq -e '.data.summary.findings == 0' |
52 | | - calcit calcit.cirru analyze quality --baseline config/calcit-quality.cirru |
53 | 55 |
|
54 | 56 | - name: Build client with CDN asset URLs |
55 | 57 | id: asset-path |
56 | 58 | env: |
57 | 59 | CDN_ORIGIN: https://cos-sh.tiye.me |
| 60 | + PR_NUMBER: ${{ github.event.pull_request.number }} |
58 | 61 | run: | |
| 62 | + set -euo pipefail |
59 | 63 | if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then |
60 | | - asset_prefix="${GITHUB_REPOSITORY}/pr/" |
61 | | - elif [[ "$GITHUB_REF" == "refs/heads/main" ]]; then |
62 | | - asset_prefix="${GITHUB_REPOSITORY}/" |
| 64 | + asset_prefix="${GITHUB_REPOSITORY}/pr/${PR_NUMBER}/" |
63 | 65 | else |
64 | | - asset_prefix="${GITHUB_REPOSITORY}/branches/${GITHUB_REF_NAME}/" |
| 66 | + asset_prefix="${GITHUB_REPOSITORY}/" |
65 | 67 | fi |
66 | 68 | export VITE_BASE_URL="${CDN_ORIGIN}/${asset_prefix}" |
67 | 69 | echo "VITE_BASE_URL=${VITE_BASE_URL}" >> "$GITHUB_ENV" |
68 | 70 | echo "prefix=${asset_prefix}" >> "$GITHUB_OUTPUT" |
69 | 71 | echo "base-url=${VITE_BASE_URL}" >> "$GITHUB_OUTPUT" |
70 | | - calcit calcit.cirru js |
| 72 | + yarn build |
71 | 73 | node --test scripts/upgrade.test.mjs |
72 | | - yarn vite build --base="$VITE_BASE_URL" |
73 | 74 |
|
74 | 75 | - name: Upload static assets to COS |
75 | 76 | if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository |
|
0 commit comments