Context Builder manual selection mode (#452) #1964
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 breadbox | |
| on: | |
| pull_request: | |
| paths: | |
| - "breadbox/**" | |
| - "breadbox-client/**" | |
| - ".github/workflows/build_breadbox.yml" | |
| types: | |
| - opened | |
| - reopened | |
| - edited | |
| - synchronize | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - "master" | |
| - "internal" | |
| - "qa" | |
| - "peddep*" | |
| - "dmc*" | |
| - "external*" | |
| - "test-*" | |
| permissions: | |
| contents: write | |
| env: | |
| DOCKER_REPO: us.gcr.io/broad-achilles/depmap-breadbox | |
| DOCKER_TAG: ga2-build-${{ github.run_number }} | |
| jobs: | |
| build-docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Update build id | |
| run: | | |
| echo "SHA=\"${{ github.sha }}\"" > breadbox/build.py | |
| - name: Login to GCR | |
| uses: docker/login-action@v1 | |
| with: | |
| registry: us.gcr.io | |
| username: _json_key | |
| password: ${{ secrets.DEPMAP_DEPLOY_SVC_ACCT }} | |
| - name: Build Elara | |
| run: | | |
| yarn --cwd frontend install | |
| yarn --cwd frontend test | |
| yarn --cwd frontend "build:elara" | |
| - name: build docker image | |
| run: bash breadbox/build-docker-image.sh ${{ env.DOCKER_REPO }}:${{ env.DOCKER_TAG }} | |
| - name: Run pyright-ratchet | |
| run: | | |
| docker run -v $PWD/breadbox/pyright-ratchet-errors.txt:/install/breadbox/pyright-ratchet-errors.txt ${{ env.DOCKER_REPO }}:${{ env.DOCKER_TAG }} poetry run pyright-ratchet | |
| - name: Push Docker image | |
| run: docker push ${{ env.DOCKER_REPO }}:${{ env.DOCKER_TAG }} | |
| run-pytest: | |
| runs-on: ubuntu-latest | |
| needs: build-docker | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Login to GCR | |
| uses: docker/login-action@v1 | |
| with: | |
| registry: us.gcr.io | |
| username: _json_key | |
| password: ${{ secrets.DEPMAP_DEPLOY_SVC_ACCT }} | |
| - name: Pull Docker image | |
| run: docker pull ${{ env.DOCKER_REPO }}:${{ env.DOCKER_TAG }} | |
| - name: Run pytest | |
| run: | | |
| cd breadbox | |
| docker run -e PYTHONWARNINGS="ignore::DeprecationWarning" -v $PWD/mypy.ini:/install/breadbox/mypy.ini -v $PWD/.env.dev:/install/breadbox/.env -v $PWD/tests:/install/breadbox/tests ${{ env.DOCKER_REPO }}:${{ env.DOCKER_TAG }} poetry run pytest | |
| push-docker-tag: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build-docker | |
| - run-pytest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Login to GCR | |
| uses: docker/login-action@v1 | |
| with: | |
| registry: us.gcr.io | |
| username: _json_key | |
| password: ${{ secrets.DEPMAP_DEPLOY_SVC_ACCT }} | |
| - name: Pull Docker image | |
| run: docker pull ${{ env.DOCKER_REPO }}:${{ env.DOCKER_TAG }} | |
| - name: Push Docker tags | |
| run: | | |
| chmod +x ./.github/push_docker.py | |
| # GITHUB_REF##*/ is github actions magic which expands to the branch name | |
| ./.github/push_docker.py ${{ env.DOCKER_REPO }} ${{ env.DOCKER_REPO }}:${{ env.DOCKER_TAG }} ${GITHUB_REF##*/} |