Skip to content

feat(api): create instr ctx methods for checking liquid presence #397

feat(api): create instr ctx methods for checking liquid presence

feat(api): create instr ctx methods for checking liquid presence #397

name: Analyses Snapshot Test
on:
workflow_dispatch:
inputs:
ANALYSIS_REF:
description: 'Branch or tag that provides the analysis output at test runtime'
required: true
default: 'edge'
SNAPSHOT_REF:
description: 'Branch or tag that provides the snapshot and test code at test runtime'
required: true
default: 'edge'
schedule:
- cron: '26 7 * * *' # 7:26 AM UTC
pull_request:
paths:
- 'api/**'
- 'shared-data/**/*'
- '!shared-data/js/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
timeout-minutes: 15
runs-on: ubuntu-latest
env:
ANALYSIS_REF: ${{ github.event.inputs.ANALYSIS_REF || github.head_ref || 'edge' }}
SNAPSHOT_REF: ${{ github.event.inputs.SNAPSHOT_REF || github.head_ref || 'edge' }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ env.SNAPSHOT_REF }}
- name: Docker Build
working-directory: analyses-snapshot-testing
run: make build-opentrons-analysis
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pipenv'
cache-dependency-path: analyses-snapshot-testing/Pipfile.lock
- name: Setup Python Dependencies
working-directory: analyses-snapshot-testing
run: make setup
- name: Run Test
id: run_test
working-directory: analyses-snapshot-testing
run: make snapshot-test
- name: Upload Report
if: '!cancelled()'
uses: actions/upload-artifact@v4
with:
name: test-report
path: analyses-snapshot-testing/results/
- name: Handle Test Failure
if: failure()
working-directory: analyses-snapshot-testing
run: make snapshot-test-update
- name: Create Snapshot update Request
id: create-pull-request
if: failure()
uses: peter-evans/create-pull-request@v5
with:
commit-message: 'fix(analyses-snapshot-testing): snapshot failure capture'
title: 'fix(analyses-snapshot-testing): ${{ env.ANALYSIS_REF }} snapshot failure capture'
body: 'This PR is an automated snapshot update request. Please review the changes and merge if they are acceptable or find your bug and fix it.'
branch: 'analyses-snapshot-testing/${{ env.ANALYSIS_REF }}-from-${{ env.SNAPSHOT_REF}}'
base: ${{ env.SNAPSHOT_REF}}
- name: Comment on PR
if: failure() && github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const message = 'A PR has been opened to address analyses snapshot changes. Please review the changes here: https://github.com/${{ github.repository }}/pull/${{ steps.create-pull-request.outputs.pull-request-number }}';
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: message
});