Skip to content

ci: alteration compatibility test #7

ci: alteration compatibility test

ci: alteration compatibility test #7

# This integration test ci job is used to test the DB alterations compatibility with the current codebase.
name: Alteration Compatibility Test
on:
push:
branches:
- master
- "push-action/**"
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check-alteration-changes:
runs-on: ubuntu-latest
steps:
- name: checkout head
uses: actions/checkout@v4
with:
fetch-depth: 0
# compare the current codebase with HEAD and check if there are any changes under the alterations folder
- name: Check for alteration changes
id: alteration-changes
run: |
CHANGE_FILES=$(git diff --name-only HEAD..origin/${{ github.base_ref }} | grep 'packages/schemas/alterations/*')
if [ -z "$CHANGE_FILES" ]; then
echo "No alteration changes detected"
echo "::set-output name=has-alteration-changes::false"
else
echo "Alteration changes detected"
echo "$CHANGE_FILES"
echo "::set-output name=has-alteration-changes::true"
fi
package:
needs: check-alteration-changes
runs-on: ubuntu-latest
if: ${{needs.check-alteration-changes.outputs.has-alteration-changes == 'true'}}
steps:
- name: checkout base
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.base_ref }}