manually copied in delete_expired_datasets command which was missing … #2224
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*" | |
| 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: | |
| check-pr-title: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'pull_request' && github.base_ref == 'master' }} | |
| defaults: | |
| run: | |
| working-directory: ./breadbox | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v3 | |
| with: | |
| token: "${{ secrets.GITHUB_TOKEN }}" | |
| fetch-depth: 0 | |
| - name: Install and configure Poetry | |
| uses: snok/install-poetry@v1 | |
| with: | |
| version: 1.7.1 | |
| virtualenvs-create: true | |
| virtualenvs-in-project: true | |
| - name: Set up cache | |
| uses: actions/cache@v3 | |
| id: cached-poetry-dependencies | |
| with: | |
| path: .venv | |
| key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | |
| - name: Install dependencies from project | |
| run: poetry install | |
| # if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
| # We want to use the rules defined in breadbox/pyproject.toml | |
| - name: Check PR title | |
| run: poetry run cz check -m '${{ github.event.pull_request.title }}' | |
| pyright-breadbox-client: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Check out" | |
| uses: actions/checkout@v3 | |
| with: | |
| token: "${{ secrets.GITHUB_TOKEN }}" | |
| fetch-depth: 0 | |
| - name: Prepare breadbox client | |
| uses: ./.github/actions/prepare-breadbox-client # checks out and generates breadbox client code | |
| - name: Check that the breadbox client passes pyright | |
| working-directory: ./breadbox-client | |
| run: "poetry install && poetry run pyright breadbox_facade" | |
| 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 Artifact Registry | |
| uses: docker/login-action@v2 | |
| 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 | |
| yarn --cwd frontend "build:elara" | |
| - name: build docker image | |
| run: bash breadbox/build-docker-image.sh ${{ env.ARTIFACT_REGISTRY_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.ARTIFACT_REGISTRY_REPO }}:${{ env.DOCKER_TAG }} poetry run pyright-ratchet | |
| - 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@v2 | |
| - name: Login to Artifact Registry | |
| uses: docker/login-action@v2 | |
| 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@v2 | |
| - name: Login to Artifact Registry | |
| uses: docker/login-action@v2 | |
| 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##*/} | |
| bump-versions: | |
| if: ${{ !startsWith(github.event.head_commit.message, 'bump:') && (!startsWith(github.actor, 'github-actions') || !startsWith(github.event.pusher.name, 'github-actions')) && (github.ref_name == 'master') && (github.event_name == 'push') }} | |
| needs: push-docker-tag | |
| runs-on: ubuntu-latest | |
| name: "Bump breadbox and breadbox-client version and create changelog with commitizen" | |
| outputs: | |
| # Map the step outputs to job outputs | |
| current_version: ${{ steps.current-version.outputs.current_version }} | |
| bumped_version: ${{ steps.bumped-version.outputs.bumped_version }} | |
| defaults: | |
| run: | |
| working-directory: ./breadbox | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v3 | |
| with: | |
| token: "${{ secrets.GITHUB_TOKEN }}" | |
| fetch-depth: 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| version: "0.7.20" | |
| - name: Store current version | |
| id: current-version | |
| run: echo "current_version=$(uvx --from commitizen cz version -p)" >> $GITHUB_OUTPUT | |
| - name: Get current version | |
| run: echo "${{ steps.current-version.outputs.current_version}}" | |
| - name: Bump version and tag | |
| run: | | |
| git config user.name github-actions | |
| git config user.email github-actions@github.com | |
| git pull origin HEAD:master | |
| uvx --from commitizen cz --no-raise 21 bump --check-consistency | |
| git push origin HEAD:master | |
| git push origin HEAD:master --tags | |
| - name: Store bumped version | |
| id: bumped-version | |
| run: echo "bumped_version=$(uvx --from commitizen cz version -p)" >> $GITHUB_OUTPUT | |
| - name: Get bumped version | |
| run: echo "${{ steps.current-version.outputs.bumped_version}}" | |
| publish-breadbox-client: | |
| needs: bump-versions | |
| if: ${{ (needs.bump-versions.outputs.current_version != needs.bump-versions.outputs.bumped_version) && (github.ref_name == 'master') }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Check out" | |
| uses: actions/checkout@v3 | |
| with: | |
| token: "${{ secrets.GITHUB_TOKEN }}" | |
| fetch-depth: 0 | |
| # pulls latest changes from head | |
| - run: | | |
| git pull origin HEAD:master | |
| - name: "Authenticate to Google Cloud" | |
| uses: google-github-actions/auth@v2 | |
| with: | |
| credentials_json: "${{ secrets.DEPMAP_ARTIFACTS_SVC_ACCT }}" | |
| - name: Prepare breadbox client | |
| uses: ./.github/actions/prepare-breadbox-client # checks out and generates breadbox client code | |
| - name: Publish breadbox client | |
| uses: ./.github/actions/publish-breadbox-client |