Skip to content

[Command] Select All Similar (Same System + Same Staff), utilizing subtype #17

[Command] Select All Similar (Same System + Same Staff), utilizing subtype

[Command] Select All Similar (Same System + Same Staff), utilizing subtype #17

name: 'Check: Visual Tests (vtests)'
on:
pull_request:
branches:
- 3.x
jobs:
run_vtests:
runs-on: ubuntu-20.04
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Retrieve base commit for PR
if: github.event_name == 'pull_request'
run: |
export BASEREF=${{ github.event.pull_request.base.sha }}
if [ -z "$BASEREF" ]; then export found=0; else export found=1; fi
echo "BASEREF=$BASEREF" >> $GITHUB_ENV
echo "found=$found" >> $GITHUB_ENV
- name: Retrieve base commit for push commit
if: github.event_name == 'push'
run: |
export BASEREF=$( git show -s --pretty=%P ${{ github.sha }} | head -c 10 )
if [ -z "$BASEREF" ]; then export found=0; else export found=1; fi
echo "BASEREF=$BASEREF" >> $GITHUB_ENV
echo "found=$found" >> $GITHUB_ENV
- name: Setup the environment
if: contains( env.found, '1')
run: |
sudo bash ./build/ci/linux/setup.sh
- name: Build
if: contains( env.found, '1')
run: |
source ./../musescore_environment.sh
make installdebug CPUS=2 PREFIX="$HOME/software" COVERAGE=ON
- name: Build reference branch
if: contains( env.found, '1')
run: |
source ./../musescore_environment.sh
mkdir -p "$HOME/softwarebase"
git checkout $BASEREF
make clean
make installdebug CPUS=2 PREFIX="$HOME/softwarebase" COVERAGE=ON 2>/dev/null
- name: Run reference vtests
if: contains( env.found, '1')
run: |
source ./../musescore_environment.sh
cd vtest
export VTEST_MSCORE="$HOME/softwarebase/bin/mscore"
export VTEST_BROWSER=ls
export VTEST_DIR=$(pwd)
xvfb-run ./gen
- name: Run vtests
if: contains( env.found, '1')
run: |
source ./../musescore_environment.sh
git checkout -
cd vtest
mkdir -p compare
find ./html -name "*-1.png" -exec mv '{}' ./compare \;
rm -rf html 2>/dev/null
export VTEST_MSCORE="$HOME/software/bin/mscore"
export VTEST_BROWSER=ls
export VTEST_DIR=$(pwd)
xvfb-run ./gen
- name: Compare vtests
if: contains( env.found, '1')
run: |
source ./../musescore_environment.sh
cd vtest
export VTEST_DIR=$(pwd)
./gen_compare
- name: Upload artifact
if: contains( env.found, '1') && contains( env.VTEST_DIFF_FOUND, 'true')
uses: actions/upload-artifact@v4
with:
name: compare
path: ./vtest/compare
- name: Skip failure signal if PR is labeled 'vtests'
if: github.event_name == 'pull_request' && contains( env.found, '1') && contains( env.VTEST_DIFF_FOUND, 'true') && contains(github.event.pull_request.labels.*.name, 'vtests')
run: |
echo "This PR appears to change some of the visual tests."
echo "Please carefully review the new visual test results in the uploaded artifact that can be found here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
echo "Failure signal skipped because 'vtests' label is applied to the PR"
export VTEST_DIFF_FOUND=false
echo "VTEST_DIFF_FOUND=$VTEST_DIFF_FOUND" >> $GITHUB_ENV
- name: Emit failure signal for PR if differences are found
if: github.event_name == 'pull_request' && contains( env.found, '1') && contains( env.VTEST_DIFF_FOUND, 'true')
run: |
echo "This PR appears to change some of the visual tests."
echo "Please carefully review the new visual test results in the uploaded artifact that can be found here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
exit 1
- name: Comment push commit
if: github.event_name == 'push' && contains( env.found, '1') && contains( env.VTEST_DIFF_FOUND, 'true')
uses: peter-evans/[email protected]
with:
body: |
This is an automatic message. This commit appears to change some of the visual tests.
Please carefully review the new visual test results in the uploaded artifact that can be found
[here][1]
[1]: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
token: ${{ secrets.GITHUB_TOKEN }}