Initialized C++ Worker #287
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: Smriti Worker CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - worker/** | |
| - .github/workflows/worker.yaml | |
| pull_request: | |
| branches: | |
| - master | |
| paths: | |
| - worker/** | |
| - .github/workflows/worker.yaml | |
| release: | |
| types: [published] | |
| jobs: | |
| ci: | |
| name: Integration Check | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./worker | |
| steps: | |
| - name: Git Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup cmake | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| with: | |
| cmake-version: "3.30.x" | |
| - name: CMake Version | |
| run: cmake --version | |
| - name: Run Lint | |
| run: | | |
| pip install cpplint | |
| cpplint --version | |
| make lint | |
| - name: Run Build | |
| run: make build-with-tests | |
| - name: Run Test & Cover | |
| run: make test | |
| - name: Publish Coverage | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: worker | |
| files: worker/coverage.xml | |
| publish: | |
| if: ${{ (github.event_name == 'release' && github.event.action == 'published') || github.ref == 'refs/heads/master' }} | |
| needs: ci | |
| name: Publish Docker Image | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./worker | |
| steps: | |
| - name: Git Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USER }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Docker Build and Push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: worker | |
| file: ./worker/Dockerfile | |
| push: true | |
| platforms: linux/amd64,linux/arm64/v8 | |
| build-args: | | |
| GITSHA=${{ github.sha }} | |
| VERSION=${ github.ref_name }} | |
| tags: smritihq/worker:${{ github.ref_name }} |