This repository was archived by the owner on May 1, 2026. It is now read-only.
feat(build init): add -a/--apikey option for non-interactive auth #2746
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: Run tests | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: | |
| - renovate/** | |
| pull_request: | |
| workflow_call: # Allow this workflow to be called by other workflows | |
| env: | |
| DENO_DIR: my_cache_directory | |
| CLICOLOR: 1 | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| cli-node-compatibility: | |
| name: CLI on Node.js ${{ matrix.node-version }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: ['20', '21', '22', '23', '24', '25'] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Setup bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Display Node.js version | |
| run: node --version | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build CLI | |
| run: bun run build | |
| - name: Test CLI --version | |
| run: node dist/index.js --version | |
| - name: Test CLI --help | |
| run: node dist/index.js --help | |
| typos: | |
| name: Check for typos | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Check spelling with typos | |
| uses: crate-ci/typos@v1.45.0 | |
| # POSIX path checks | |
| create-valid-zip-linux: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Setup bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| id: install_code | |
| run: bun install --frozen-lockfile | |
| - name: Install test_upload dependencies | |
| run: cd test/test_upload && npm install | |
| - name: Build code | |
| id: build_code | |
| run: bun run build | |
| - name: Create a valid zip test | |
| id: create_zip | |
| run: node ./dist/index.js bundle zip --path test/test_upload -n build-linux.zip --package-json test/test_upload/package.json | |
| - name: Check build directory contents | |
| run: | | |
| echo "Listing contents of the build directory..." | |
| ls -R ./dist | |
| - name: Check ZIP file contents | |
| run: | | |
| echo "Listing contents of the ZIP file..." | |
| unzip -l build-linux.zip | |
| - name: Upload build-linux.zip artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: build-zip-linux | |
| path: build-linux.zip | |
| check-posix-paths-windows: | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| strategy: | |
| matrix: | |
| os: [windows-2025, windows-2022] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Setup bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| id: install_code | |
| run: bun install --frozen-lockfile | |
| - name: Install test_upload dependencies | |
| run: cd test/test_upload && npm install | |
| - name: Build code | |
| id: build_code | |
| run: bun run build | |
| - name: Create a zip test | |
| id: create_zip | |
| run: node ./dist/index.js bundle zip --path test/test_upload -n build-${{ matrix.os }}.zip --package-json test/test_upload/package.json | |
| - name: Upload build.zip artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: build-zip-${{ matrix.os }} | |
| path: build-${{ matrix.os }}.zip | |
| check-posix-paths-unix: | |
| runs-on: ubuntu-latest | |
| needs: [create-valid-zip-linux, check-posix-paths-windows] | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Download build-linux.zip artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: build-zip-linux | |
| - name: List the files | |
| run: ls -lh | |
| - name: Check file size of Linux build | |
| run: ls -lh build-linux.zip | |
| - name: Verify ZIP file integrity for Linux build with zipinfo | |
| run: | | |
| echo "Verifying ZIP file integrity for Linux build with zipinfo..." | |
| zipinfo ./build-linux.zip || (echo "ZIP file is corrupted: build-linux.zip" && exit 1) | |
| - name: Verify POSIX paths for Linux build | |
| run: | | |
| unzip build-linux.zip -d extracted-linux | |
| if find extracted-linux -type f | grep -qE '\\\\'; then | |
| echo "Non-POSIX paths detected in build-linux.zip." | |
| exit 1 | |
| else | |
| echo "All paths are POSIX compliant in build-linux.zip." | |
| fi | |
| - name: Setup Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: zulu | |
| java-version: '17' | |
| - name: Compile VerifyZip.java | |
| run: javac ./test/VerifyZip.java | |
| - name: Verify ZIP file integrity for Linux build with Java | |
| run: java -cp ./test VerifyZip build-linux.zip | |
| - name: Download build-windows-2025.zip artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: build-zip-windows-2025 | |
| - name: Download build-windows-2022.zip artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: build-zip-windows-2022 | |
| - name: List the files | |
| run: ls -lh | |
| - name: Check file sizes of Windows builds | |
| run: | | |
| echo "Checking file sizes..." | |
| ls -lh build-windows-2025.zip | |
| ls -lh build-windows-2022.zip | |
| - name: Verify ZIP file integrity for Windows 2025 build with zipinfo | |
| run: | | |
| echo "Verifying ZIP file integrity for Windows 2025 build with zipinfo..." | |
| zipinfo ./build-windows-2025.zip || (echo "ZIP file is corrupted: build-windows-2025.zip" && exit 1) | |
| - name: Verify ZIP file integrity for Windows 2022 build with zipinfo | |
| run: | | |
| echo "Verifying ZIP file integrity for Windows 2022 build with zipinfo..." | |
| zipinfo ./build-windows-2022.zip || (echo "ZIP file is corrupted: build-windows-2022.zip" && exit 1) | |
| - name: Verify POSIX paths for Windows 2025 build | |
| run: | | |
| unzip build-windows-2025.zip -d extracted-2025 | |
| if find extracted-2025 -type f | grep -qE '\\\\'; then | |
| echo "Non-POSIX paths detected in build-windows-2025.zip." | |
| exit 1 | |
| else | |
| echo "All paths are POSIX compliant in build-windows-2025.zip." | |
| fi | |
| - name: Verify POSIX paths for Windows 2022 build | |
| run: | | |
| unzip build-windows-2022.zip -d extracted-2022 | |
| if find extracted-2022 -type f | grep -qE '\\\\'; then | |
| echo "Non-POSIX paths detected in build-windows-2022.zip." | |
| exit 1 | |
| else | |
| echo "All paths are POSIX compliant in build-windows-2022.zip." | |
| fi | |
| - name: Verify ZIP file integrity for Windows 2025 build with Java | |
| run: java -cp ./test VerifyZip build-windows-2025.zip | |
| - name: Verify ZIP file integrity for Windows 2022 build with Java | |
| run: java -cp ./test VerifyZip build-windows-2022.zip | |
| check-posix-paths-macos: | |
| runs-on: macos-latest | |
| needs: [create-valid-zip-linux, check-posix-paths-windows] | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Download build-linux.zip artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: build-zip-linux | |
| - name: Download build-windows-2025.zip artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: build-zip-windows-2025 | |
| - name: Download build-windows-2022.zip artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: build-zip-windows-2022 | |
| - name: List the files | |
| run: ls -lh | |
| - name: Check file size of Linux build | |
| run: ls -lh build-linux.zip | |
| - name: Setup Swift | |
| uses: swift-actions/setup-swift@v3 | |
| - name: Get swift version | |
| run: swift --version # Swift 5.10 | |
| - name: Compile test executable | |
| run: swift build -c release | |
| working-directory: ./test/test_zip_swift/ | |
| - name: Run the swift test | |
| run: ./test/test_zip_swift/.build/release/MyCLI --zip-files build-linux.zip build-windows-2025.zip build-windows-2022.zip | |
| posix-paths-final: | |
| needs: [check-posix-paths-unix, check-posix-paths-macos] | |
| runs-on: ubuntu-latest | |
| name: POSIX Paths final | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Final check | |
| run: echo "All POSIX path checks completed successfully" | |
| web: | |
| runs-on: ubuntu-latest | |
| name: Run tests | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v6 | |
| - name: Setup bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - name: Install dependencies | |
| id: install_code | |
| run: bun install --frozen-lockfile | |
| - name: Lint | |
| id: lint_code | |
| run: bun run lint | |
| - name: Build | |
| id: build_code | |
| run: bun run build | |
| - name: Quick ESM SDK check | |
| id: esm_sdk_check | |
| run: bun run test:esm-sdk | |
| - name: Run | |
| id: run_cli | |
| run: node dist/index.js --help | |
| - name: Setup test fixtures for version detection | |
| id: setup_fixtures | |
| run: ./test/fixtures/setup-test-projects.sh | |
| - name: Run validation tests | |
| id: validation_tests | |
| run: bun run test | |
| # New steps for Capgo backend setup | |
| - name: Cache Deno dependencies | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ env.DENO_DIR }} | |
| key: my_cache_key | |
| - name: Checkout capgo | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: Cap-go/capgo | |
| path: capgo | |
| - name: Install Supabase CLI | |
| uses: supabase/setup-cli@v1 | |
| with: | |
| version: latest | |
| - name: Run Supabase Start | |
| working-directory: capgo | |
| run: supabase start -x imgproxy,studio,realtime,studio,logflare,vector,inbucket | |
| - name: Install Capgo dependencies | |
| working-directory: capgo | |
| run: bun install | |
| - name: Install local @capgo/cli package | |
| working-directory: capgo | |
| run: bun add -d file:.. | |
| - name: Run CLI tests | |
| working-directory: capgo | |
| run: LOCAL_CLI_PATH="../../../dist/index.js" bun run test:cli |