Breadbox releases api phase2 - release_versions CRUD, CRUD tests, and api #2739
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: | |
| ARTIFACT_REGISTRY_REPO: us-central1-docker.pkg.dev/depmap-consortium/depmap-docker-images/depmap-breadbox | |
| DOCKER_TAG: ga2-build-${{ github.run_number }} | |
| jobs: | |
| build-docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 | |
| - name: Update build id | |
| run: | | |
| echo "SHA=\"${{ github.sha }}\"" > breadbox/build.py | |
| - name: Login to Artifact Registry | |
| uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0 | |
| with: | |
| registry: us-central1-docker.pkg.dev | |
| username: _json_key | |
| password: ${{ secrets.DEPMAP_DEPLOY_SVC_ACCT }} | |
| - name: Build Elara | |
| run: | | |
| yarn --cwd frontend install | |
| yarn --cwd frontend test | |
| - name: build docker image | |
| run: bash breadbox/build-docker-image.sh ${{ env.ARTIFACT_REGISTRY_REPO }}:${{ env.DOCKER_TAG }} | |
| - name: Run pyright | |
| run: | | |
| docker run ${{ env.ARTIFACT_REGISTRY_REPO }}:${{ env.DOCKER_TAG }} poetry run pyright | |
| - name: Push Docker image | |
| run: docker push ${{ env.ARTIFACT_REGISTRY_REPO }}:${{ env.DOCKER_TAG }} | |
| run-pytest: | |
| runs-on: ubuntu-latest | |
| needs: build-docker | |
| steps: | |
| - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 | |
| - name: Login to Artifact Registry | |
| uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0 | |
| with: | |
| registry: us-central1-docker.pkg.dev | |
| username: _json_key | |
| password: ${{ secrets.DEPMAP_DEPLOY_SVC_ACCT }} | |
| - name: Pull Docker image | |
| run: docker pull ${{ env.ARTIFACT_REGISTRY_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.ARTIFACT_REGISTRY_REPO }}:${{ env.DOCKER_TAG }} poetry run pytest | |
| push-docker-tag: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build-docker | |
| - run-pytest | |
| steps: | |
| - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 | |
| - name: Login to Artifact Registry | |
| uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0 | |
| with: | |
| registry: us-central1-docker.pkg.dev | |
| username: _json_key | |
| password: ${{ secrets.DEPMAP_DEPLOY_SVC_ACCT }} | |
| - name: Pull Docker image | |
| run: docker pull ${{ env.ARTIFACT_REGISTRY_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.ARTIFACT_REGISTRY_REPO }} ${{ env.ARTIFACT_REGISTRY_REPO }}:${{ env.DOCKER_TAG }} ${GITHUB_REF##*/} |