[frontend] add open/close animation to menus #281
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: CI | |
| on: | |
| push: | |
| paths-ignore: | |
| - ".github/workflows/**" | |
| pull_request: | |
| paths-ignore: | |
| - ".github/workflows/**" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build Scramjet | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: "pnpm" | |
| - name: Install pnpm dependencies | |
| run: pnpm install | |
| - name: Cache rewriter build artifacts | |
| uses: actions/cache@v4 | |
| id: rewriter-cache | |
| with: | |
| path: | | |
| rewriter/wasm/out | |
| dist/scramjet.wasm.wasm | |
| key: rewriter-release-${{ hashFiles('rewriter/wasm/Cargo.toml', 'rewriter/wasm/src/**/*.rs', 'rewriter/wasm/build.sh') }} | |
| restore-keys: | | |
| rewriter-release- | |
| - name: Cache Rust dependencies | |
| if: steps.rewriter-cache.outputs.cache-hit != 'true' | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: "rewriter" | |
| cache-all-crates: true | |
| - name: Install wbg | |
| if: steps.rewriter-cache.outputs.cache-hit != 'true' | |
| uses: jetli/[email protected] | |
| with: | |
| version: "0.2.100" | |
| - name: Setup Binaryen | |
| if: steps.rewriter-cache.outputs.cache-hit != 'true' | |
| uses: Aandreba/[email protected] | |
| with: | |
| token: ${{ github.token }} | |
| - name: Setup wasm-snip | |
| if: steps.rewriter-cache.outputs.cache-hit != 'true' | |
| run: "cargo install --git https://github.com/r58playz/wasm-snip" | |
| - name: Pack Scramjet | |
| run: pnpm pack | |
| - name: Upload Artifact (pnpm pack) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: packaged-scramjet | |
| path: mercuryworkshop-scramjet-*.tgz | |
| - name: Upload Artifact (dist) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: scramjet | |
| path: | | |
| dist/*.js | |
| dist/*.js.map | |
| dist/*.wasm | |
| frontend: | |
| name: Build Frontend | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: "pnpm" | |
| - name: Install Depot Tools | |
| uses: newkdev/[email protected] | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Get artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: scramjet | |
| path: dist | |
| - name: Build Dreamland | |
| run: | | |
| cd dreamlandjs | |
| pnpm build | |
| - name: Build Chii | |
| run: | | |
| cd chii | |
| pnpm init:front_end | |
| pnpm build | |
| - name: Build Chobitsu | |
| run: | | |
| cd chobitsu | |
| pnpm webpack build --mode development | |
| - name: Build page_inject | |
| run: | | |
| cd page_inject | |
| npx rollup -c | |
| - name: Build Frontend | |
| run: | | |
| cd frontend | |
| pnpm vite build | |
| tests: | |
| name: Run Scramjet Tests | |
| runs-on: ubuntu-latest | |
| needs: build | |
| env: | |
| PLAYWRIGHT_BROWSERS_PATH: .playwright-browsers | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Get artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: scramjet | |
| path: dist | |
| - name: Cache Playwright browsers | |
| id: pw-browsers-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .playwright-browsers | |
| key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: | | |
| playwright-${{ runner.os }}- | |
| - name: Install Playwright Chromium | |
| if: steps.pw-browsers-cache.outputs.cache-hit != 'true' | |
| run: npx playwright install --with-deps chromium | |
| - name: Run Playwright tests | |
| run: pnpm test | |
| # upload: | |
| # name: Upload release | |
| # runs-on: ubuntu-latest | |
| # needs: [build, tests] | |
| # permissions: write-all | |
| # if: github.ref == 'refs/heads/main' | |
| # steps: | |
| # - name: Delete old release and tag | |
| # uses: dev-drprasad/[email protected] | |
| # with: | |
| # delete_release: true | |
| # tag_name: latest | |
| # github_token: ${{ github.token }} | |
| # - name: Get artifacts | |
| # uses: actions/download-artifact@v4 | |
| # with: | |
| # name: packaged-scramjet | |
| # path: . | |
| # - name: Release to GitHub | |
| # uses: ncipollo/release-action@v1 | |
| # with: | |
| # name: Continuous Build | |
| # tag: latest | |
| # commit: main | |
| # body: "${{ github.event.head_commit.url }} ${{ github.event.head_commit.message }}" | |
| # artifacts: "mercuryworkshop-scramjet-*.tgz" | |
| # prerelease: true | |
| # publish: | |
| # name: Publish Scramjet to NPM | |
| # runs-on: ubuntu-latest | |
| # needs: [build, tests] | |
| # if: false | |
| # permissions: write-all | |
| # steps: | |
| # - name: Setup Node.js | |
| # uses: actions/setup-node@v2 | |
| # with: | |
| # node-version: "20" | |
| # registry-url: "https://registry.npmjs.org" | |
| # - name: Get artifacts | |
| # uses: actions/download-artifact@v4 | |
| # with: | |
| # name: packaged-scramjet | |
| # path: . | |
| # - name: Extract package | |
| # run: tar xvf mercuryworkshop-scramjet-*.tgz package --strip-components=1 | |
| # - name: Check the version | |
| # id: check | |
| # run: | | |
| # CURRENT_VERSION=$(jq -r .version package.json) | |
| # echo "Current version: $CURRENT_VERSION" | |
| # LATEST_VERSION=$(npm view @mercuryworkshop/scramjet version || echo "0.0.0") | |
| # echo "Latest NPM version: $LATEST_VERSION" | |
| # if [ "$LATEST_VERSION" != "$CURRENT_VERSION" ]; | |
| # then | |
| # echo "Version changed" | |
| # echo "version_changed=true" >> $GITHUB_OUTPUT | |
| # echo "new_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT | |
| # else | |
| # echo "Version not changed" | |
| # echo "version_changed=false" >> $GITHUB_OUTPUT | |
| # fi | |
| # - name: Publish | |
| # if: steps.check.outputs.version_changed == 'true' | |
| # run: npm publish --access public --no-git-checks | |
| # env: | |
| # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| # pages: | |
| # name: Upload to Github Pages | |
| # runs-on: ubuntu-latest | |
| # needs: [build, tests] | |
| # permissions: write-all | |
| # if: github.ref == 'refs/heads/main' | |
| # steps: | |
| # - name: Checkout code | |
| # uses: actions/checkout@v4 | |
| # - name: Setup pnpm | |
| # uses: pnpm/action-setup@v4 | |
| # with: | |
| # version: latest | |
| # - name: Setup Node.js | |
| # uses: actions/setup-node@v4 | |
| # with: | |
| # node-version: "22" | |
| # cache: "pnpm" | |
| # - name: Install dependencies | |
| # run: pnpm install | |
| # - name: Get artifacts | |
| # uses: actions/download-artifact@v4 | |
| # with: | |
| # name: scramjet | |
| # path: dist | |
| # - name: build statics | |
| # run: bash ./ci/buildstatic.sh | |
| # - name: upload pages artifact | |
| # uses: actions/upload-pages-artifact@v3 | |
| # with: | |
| # path: "./staticbuild" | |
| # - name: deploy to github | |
| # id: deployment | |
| # uses: actions/deploy-pages@v4 |