Skip to content

Merge pull request #2479 from SwiftPackageIndex/re-enable-tsan #2147

Merge pull request #2479 from SwiftPackageIndex/re-enable-tsan

Merge pull request #2479 from SwiftPackageIndex/re-enable-tsan #2147

Workflow file for this run

# Copyright Dave Verwer, Sven A. Schmidt, and other contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Snapshots
on:
workflow_dispatch:
push:
jobs:
snapshots:
name: Image Snapshots
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build Front-End
run: make build-front-end
- name: Copy Front-End
run: cp -a ./Public/* ./Tests/AppTests/__Snapshots__/WebpageSnapshotTests
- name: Determine Comparison Git Reference
id: determine-comparison-ref
run: |
branch=$(git branch --show-current)
if [ $branch == "main" ]; then
echo "::set-output name=comparison-ref::HEAD^"
else
echo "::set-output name=comparison-ref::origin/main"
fi
- name: Diff for Front-End Changes
id: front-end-changes
run: |
filecount=$(git diff ${{steps.determine-comparison-ref.outputs.comparison-ref}} --shortstat "**.html" "**.scss" "**.js" ".percy.yml" ".github/workflows/snapshots.yml" | awk '{print $1}')
echo "::set-output name=matching-files::${filecount:-0}"
- name: Run Percy
if: steps.front-end-changes.outputs.matching-files != '0'
run: npx @percy/cli snapshot --verbose ./Tests/AppTests/__Snapshots__/WebpageSnapshotTests
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}