Upgrading dependencies #1117
Workflow file for this run
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: Analyze | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| Analyze: | |
| if: ${{ !contains(github.event.head_commit.message, 'Bump version') }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| python-version: [3.11] | |
| os: [ubuntu-latest] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/dependencies | |
| - name: Pack test recipe | |
| run: | | |
| uv run pack -r cellpack/tests/recipes/v2/test_spheres.json -c cellpack/tests/packing-configs/test_config.json | |
| - name: Modify JSON with PR sub_directory path | |
| run: | | |
| jq --arg branch_name "${{ github.ref_name }}" '.create_report.output_image_location |= "https://cellpack-results.s3.us-west-2.amazonaws.com/\($branch_name)/spheresSST/figures"' cellpack/tests/analysis-configs/PR_analysis_config.json > cellpack/tests/analysis-configs/PR_analysis_config_temp.json | |
| mv cellpack/tests/analysis-configs/PR_analysis_config_temp.json cellpack/tests/analysis-configs/PR_analysis_config.json | |
| - name: Run analysis code | |
| run: uv run analyze -r cellpack/tests/recipes/v2/test_spheres.json -a cellpack/tests/analysis-configs/PR_analysis_config.json -p cellpack/tests/outputs/test_spheres/spheresSST | |
| - name: Upload results | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: results | |
| path: cellpack/tests/outputs/test_spheres/ | |
| Comment: | |
| runs-on: ubuntu-latest | |
| needs: [Analyze] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Configure AWS credentials for dependabot | |
| if: ${{ github.actor == 'dependabot[bot]' }} | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| aws-access-key-id: ${{ secrets.DEPENDABOT_AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.DEPENDABOT_AWS_SECRET_ACCESS_KEY }} | |
| aws-region: us-west-2 | |
| - name: Configure AWS credentials | |
| if: ${{ github.actor != 'dependabot[bot]' }} | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: us-west-2 | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: results | |
| path: ./results | |
| - name: Copy files to results bucket | |
| run: aws s3 cp ./results s3://cellpack-results/${{ github.ref_name }}/ --recursive --acl public-read | |
| - name: Update comment for dependabot | |
| if: ${{ github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' }} | |
| env: | |
| GH_TOKEN: ${{ secrets.DEPENDABOT_TOKEN }} | |
| run: | | |
| MARKER="<!-- Analyze workflow report -->" | |
| COMMENT_BODY="${MARKER} | |
| $(cat ./results/analysis_report.md)" | |
| EXISTING_COMMENT_ID=$(gh api "/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" --jq ".[] | select(.body | contains(\"${MARKER}\")) | .id" | head -1) | |
| if [ -n "$EXISTING_COMMENT_ID" ]; then | |
| echo "Updating existing comment with ID: $EXISTING_COMMENT_ID" | |
| echo "$COMMENT_BODY" | gh api -X PATCH "/repos/${{ github.repository }}/issues/comments/$EXISTING_COMMENT_ID" -F body=@- | |
| else | |
| echo "Creating new comment" | |
| echo "$COMMENT_BODY" | gh pr comment ${{ github.event.pull_request.number }} --body-file - | |
| fi | |
| cat ./results/analysis_report.md | |
| - name: Update comment for PR | |
| if: ${{ github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }} | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| MARKER="<!-- Analyze workflow report -->" | |
| COMMENT_BODY="${MARKER} | |
| $(cat ./results/analysis_report.md)" | |
| EXISTING_COMMENT_ID=$(gh api "/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" --jq ".[] | select(.body | contains(\"${MARKER}\")) | .id" | head -1) | |
| if [ -n "$EXISTING_COMMENT_ID" ]; then | |
| echo "Updating existing comment with ID: $EXISTING_COMMENT_ID" | |
| echo "$COMMENT_BODY" | gh api -X PATCH "/repos/${{ github.repository }}/issues/comments/$EXISTING_COMMENT_ID" -F body=@- | |
| else | |
| echo "Creating new comment" | |
| echo "$COMMENT_BODY" | gh pr comment ${{ github.event.pull_request.number }} --body-file - | |
| fi | |
| cat ./results/analysis_report.md |