Merge pull request #5 from dev-phantom/cicd #9
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: | |
| branches: [master, develop] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [18.x, 20.x] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build packages (only published packages) | |
| run: | | |
| npm run build:shared | |
| npm run build:core | |
| npm run build:cli | |
| - name: Run linter (only published packages) | |
| run: | | |
| npm run lint --workspace=packages/shared --if-present | |
| npm run lint --workspace=packages/core --if-present | |
| npm run lint --workspace=packages/cli --if-present | |
| - name: Run tests (only published packages) | |
| run: | | |
| npm test --workspace=packages/shared --if-present | |
| npm test --workspace=packages/core --if-present | |
| npm test --workspace=packages/cli --if-present | |
| - name: Check package integrity | |
| run: | | |
| cd packages/cli && npm pack --dry-run | |
| cd ../core && npm pack --dry-run | |
| cd ../shared && npm pack --dry-run | |
| build-android: | |
| runs-on: ubuntu-latest | |
| needs: build-and-test | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| - name: Setup JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Install Node dependencies | |
| run: npm ci | |
| - name: Build packages (only published packages) | |
| run: | | |
| npm run build:shared | |
| npm run build:core | |
| npm run build:cli | |
| - name: Build Android client | |
| run: | | |
| cd packages/client | |
| chmod +x gradlew | |
| ./gradlew assembleDebug --no-daemon | |
| - name: Upload APK artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jetstart-client-debug | |
| path: packages/client/app/build/outputs/apk/debug/app-debug.apk | |
| retention-days: 7 |