Update package version (#1669) #147
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: Regression testing | |
| on: | |
| #pull_request: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "package.json" | |
| - "@versions/node-sdk.ts" | |
| workflow_dispatch: | |
| jobs: | |
| detect-version-bump: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version_changed: ${{ steps.check-version.outputs.version_changed }} | |
| new_version: ${{ steps.extract-version.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup test env | |
| uses: ./.github/actions/xmtp-test-setup | |
| - name: Check for version changes | |
| id: check-version | |
| run: | | |
| git diff HEAD^ HEAD -- package.json lerna.json */package.json | grep -q '"version"' && \ | |
| echo "version_changed=true" >> $GITHUB_OUTPUT || \ | |
| echo "version_changed=false" >> $GITHUB_OUTPUT | |
| - name: Extract new version | |
| id: extract-version | |
| if: steps.check-version.outputs.version_changed == 'true' | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| validate-regression: | |
| needs: detect-version-bump | |
| runs-on: ubuntu-latest | |
| env: | |
| DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }} | |
| REGION: ${{ vars.REGION }} | |
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup test env | |
| uses: ./.github/actions/xmtp-test-setup | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Run regression tests | |
| run: yarn regression | |
| - name: Send Slack notification on failure | |
| if: failure() || cancelled() | |
| uses: ./.github/actions/slack-notification | |
| with: | |
| workflow-name: "Regression testing" | |
| slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} |