Repository navigation
升级 ClojureScript 站点至 Calcit 0.51.0 #53
Workflow file for this run
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 and upload | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: {} | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@v6.5.0 | |
| with: | |
| node-version: 24 | |
| package-manager-cache: false | |
| - uses: calcit-lang/setup-calcit@v1.5.1 | |
| with: | |
| tools: calcit,caps | |
| caps-version: "0.1.1" | |
| deps-file: deps.cirru | |
| - name: Install dependencies | |
| run: | | |
| set -euo pipefail | |
| corepack enable | |
| corepack prepare yarn@4.18.0 --activate | |
| caps --strict --ci | |
| yarn install --immutable | |
| caps verify --toolchain | |
| git diff --quiet -- deps.cirru package.json yarn.lock .yarnrc.yml | |
| - name: Check and test Calcit | |
| run: | | |
| set -euo pipefail | |
| calcit edit format | |
| git diff --quiet -- calcit.cirru | |
| calcit --check-only --all-defs --format json | |
| calcit fix --workflow strict --verify --format json | jq -e '.data.workflow.status == "passed" and .diagnostics == []' | |
| calcit analyze weak-types --ns-prefix app --only deprecated-call --summary-only --format json | jq -e '.data.summary.calls == 0' | |
| calcit analyze weak-types --only dynamic-method --summary-only --format json | jq -e '.data.summary.findings == 0' | |
| calcit test --require-match --summary-only --format json | |
| - name: Build frontend | |
| run: | | |
| set -euo pipefail | |
| calcit js | |
| base_url="https://cos-sh.tiye.me/${GITHUB_REPOSITORY}/" | |
| if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then | |
| base_url="./" | |
| fi | |
| yarn vite build --base="$base_url" | |
| - uses: actions/upload-artifact@v7.0.2 | |
| with: | |
| name: client-dist | |
| path: dist/ | |
| if-no-files-found: error | |
| retention-days: 7 | |
| upload: | |
| needs: test | |
| if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 15 | |
| concurrency: | |
| group: cos-${{ github.repository }} | |
| cancel-in-progress: false | |
| queue: max | |
| steps: | |
| - uses: actions/download-artifact@v8.0.2 | |
| with: | |
| name: client-dist | |
| path: dist/ | |
| - name: Upload and verify frontend resources | |
| uses: worktools/cos-upload-action@v1.3.0 | |
| with: | |
| source-dir: dist | |
| bucket: ${{ secrets.COS_BUCKET }} | |
| region: ap-shanghai | |
| prefix: ${{ github.repository }}/ | |
| public-base-url: https://cos-sh.tiye.me/${{ github.repository }}/ | |
| secret-id: ${{ secrets.COS_SECRET_ID }} | |
| secret-key: ${{ secrets.COS_SECRET_KEY }} | |
| - name: Deploy to original server path | |
| uses: Pendect/action-rsyncer@v2.0.0 | |
| env: | |
| DEPLOY_KEY: ${{ secrets.rsync_private_key }} | |
| with: | |
| flags: '-avzr --progress' | |
| options: '' | |
| ssh_options: '' | |
| src: 'dist/*' | |
| dest: 'rsync-user@tiye.me:/web-assets/repo/${{ github.repository }}' |