diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 472bcf0..439345f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -254,15 +254,6 @@ jobs: time CI_TESTING_CONFIG=$example cargo run --example $example_name sleep 10 done - - name: Save PR number - if: ${{ github.event_name == 'pull_request' }} - run: | - echo ${{ github.event.number }} > ./screenshots/PR - - uses: actions/upload-artifact@v4 - if: ${{ failure() && github.event_name == 'pull_request' }} - with: - name: example-run-macos - path: example-run/ check-doc: runs-on: ubuntu-latest diff --git a/.github/workflows/send-screenshots-to-pixeleagle.yml b/.github/workflows/send-screenshots-to-pixeleagle.yml deleted file mode 100644 index 2f15774..0000000 --- a/.github/workflows/send-screenshots-to-pixeleagle.yml +++ /dev/null @@ -1,94 +0,0 @@ -name: Send Screenshots to Pixel Eagle - -on: - workflow_call: - inputs: - artifact: - required: true - type: string - commit: - required: true - type: string - branch: - required: true - type: string - os: - required: true - type: string - -jobs: - send-to-pixel-eagle: - name: Send screenshots to Pixel Eagle - runs-on: ubuntu-24.04 - steps: - - - name: Download artifact - uses: actions/download-artifact@v4 - with: - pattern: ${{ inputs.artifact }} - - - name: Send to Pixel Eagle - env: - project: B04F67C0-C054-4A6F-92EC-F599FEC2FD1D - run: | - # Create a new run with its associated metadata - metadata='{"os":"${{ inputs.os }}", "commit": "${{ inputs.commit }}", "branch": "${{ inputs.branch }}"}' - run=`curl https://pixel-eagle.vleue.com/$project/runs --json "$metadata" --oauth2-bearer ${{ secrets.PIXELEAGLE_TOKEN }} | jq '.id'` - - SAVEIFS=$IFS - - cd ${{ inputs.artifact }} - - # Read the hashes of the screenshot for fast comparison when they are equal - IFS=$'\n' - # Build a json array of screenshots and their hashes - hashes='['; - for screenshot in $(find . -type f -name "*.png"); - do - name=${screenshot:14} - echo $name - hash=`shasum -a 256 $screenshot | awk '{print $1}'` - hashes="$hashes [\"$name\",\"$hash\"]," - done - hashes=`echo $hashes | rev | cut -c 2- | rev` - hashes="$hashes]" - - IFS=$SAVEIFS - - # Upload screenshots with unknown hashes - curl https://pixel-eagle.vleue.com/$project/runs/$run/hashes --json "$hashes" --oauth2-bearer ${{ secrets.PIXELEAGLE_TOKEN }} | jq '.[]|[.name] | @tsv' | - while IFS=$'\t' read -r name; do - name=`echo $name | tr -d '"'` - echo "Uploading $name" - curl https://pixel-eagle.vleue.com/$project/runs/$run/screenshots -F "data=@./screenshots-$name" -F "screenshot=$name" --oauth2-bearer ${{ secrets.PIXELEAGLE_TOKEN }} - echo - done - - IFS=$SAVEIFS - - cd .. - - # Trigger comparison with the main branch on the same os - curl https://pixel-eagle.vleue.com/$project/runs/$run/compare/auto --json '{"os":"", "branch": "main"}' --oauth2-bearer ${{ secrets.PIXELEAGLE_TOKEN }} > pixeleagle.json - - # Log results - compared_with=`cat pixeleagle.json | jq '.to'` - - status=0 - missing=`cat pixeleagle.json | jq '.missing | length'` - if [ ! $missing -eq 0 ]; then - echo "There are $missing missing screenshots" - echo "::warning title=$missing missing screenshots on ${{ inputs.os }}::https://pixel-eagle.vleue.com/$project/runs/$run/compare/$compared_with" - status=1 - fi - - diff=`cat pixeleagle.json | jq '.diff | length'` - if [ ! $diff -eq 0 ]; then - echo "There are $diff screenshots with a difference" - echo "::warning title=$diff different screenshots on ${{ inputs.os }}::https://pixel-eagle.vleue.com/$project/runs/$run/compare/$compared_with" - status=1 - fi - - echo "created run $run: https://pixel-eagle.vleue.com/$project/runs/$run/compare/$compared_with" - - exit $status