Add build validation workflow for Node and platform binaries #4
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: Build Validation | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| verify-node-build: | |
| name: Verify Node Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "16.x" | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Verify CLI runs with Node | |
| run: node index.js -v | |
| - name: Verify npm package can be built | |
| run: npm pack | |
| verify-platform-binaries: | |
| name: Verify Platform Binaries | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "16.x" | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: "latest" | |
| - name: Setup QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: amd64,arm64 | |
| - name: Setup ldid | |
| run: | | |
| git clone https://github.com/tpoechtrager/ldid | |
| cd ./ldid | |
| sudo make | |
| sudo make install | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Build all platform binaries | |
| run: | | |
| rm -rf build | |
| mkdir -p build | |
| bun run linux-x64 | |
| bun run linux-arm64 | |
| bun run windows-x64 | |
| bun run windows-arm64 | |
| bun run mac-x64 | |
| bun run mac-arm64 | |
| - name: Verify generated binaries | |
| run: | | |
| test -s build/appwrite-cli-linux-x64 | |
| test -s build/appwrite-cli-linux-arm64 | |
| test -s build/appwrite-cli-win-x64.exe | |
| test -s build/appwrite-cli-win-arm64.exe | |
| test -s build/appwrite-cli-darwin-x64 | |
| test -s build/appwrite-cli-darwin-arm64 |