Upgrade to waterfall tools 0.4.0 (#4801) #5278
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: Docker | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.arch.runner }} | |
| if: ${{ !contains(github.event.head_commit.message, 'docs:') }} | |
| strategy: | |
| matrix: | |
| arch: | |
| - { platform: amd64, runner: ubuntu-24.04 } | |
| - { platform: arm64, runner: ubuntu-24.04-arm } | |
| image: | |
| - { name: full, file: Dockerfile, tag: 'sitespeedio/sitespeed.io' } | |
| - { name: slim, file: Dockerfile-slim, tag: 'sitespeedio/sitespeed.io:slim' } | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4 | |
| - name: Build ${{ matrix.image.name }} image (${{ matrix.arch.platform }}) | |
| uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7 | |
| with: | |
| context: . | |
| file: ${{ matrix.image.file }} | |
| platforms: linux/${{ matrix.arch.platform }} | |
| build-args: | | |
| TARGETPLATFORM=linux/${{ matrix.arch.platform }} | |
| tags: ${{ matrix.image.tag }} | |
| cache-from: type=gha,scope=${{ matrix.image.name }}-${{ matrix.arch.platform }} | |
| cache-to: type=gha,scope=${{ matrix.image.name }}-${{ matrix.arch.platform }},mode=max | |
| outputs: type=docker,dest=/tmp/${{ matrix.image.name }}.tar | |
| - name: Upload image artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docker-${{ matrix.image.name }}-${{ matrix.arch.platform }} | |
| path: /tmp/${{ matrix.image.name }}.tar | |
| retention-days: 1 | |
| compression-level: 0 | |
| test-default: | |
| needs: build | |
| runs-on: ${{ matrix.arch.runner }} | |
| if: ${{ !contains(github.event.head_commit.message, 'docs:') }} | |
| strategy: | |
| matrix: | |
| arch: | |
| - { platform: amd64, runner: ubuntu-24.04 } | |
| - { platform: arm64, runner: ubuntu-24.04-arm } | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Download images | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: /tmp | |
| pattern: docker-*-${{ matrix.arch.platform }} | |
| merge-multiple: true | |
| - name: Load images | |
| run: | | |
| docker load --input /tmp/full.tar | |
| docker load --input /tmp/slim.tar | |
| - name: Install local HTTP server | |
| run: npm install serve -g | |
| - name: Start local HTTP server | |
| run: (serve test/data/html/ -l 3001&) | |
| - name: Run test on default container for Chrome | |
| run: docker run --rm -v "$(pwd)":/sitespeed.io --network=host sitespeedio/sitespeed.io http://127.0.0.1:3001 -n 1 -b chrome | |
| - name: Run test on default container for Firefox | |
| run: docker run --rm -v "$(pwd)":/sitespeed.io --network=host sitespeedio/sitespeed.io http://127.0.0.1:3001 -n 1 -b firefox | |
| - name: Run test on default container for Edge | |
| if: matrix.arch.platform == 'amd64' | |
| run: docker run --rm -v "$(pwd)":/sitespeed.io --network=host sitespeedio/sitespeed.io http://127.0.0.1:3001 -n 1 -b edge | |
| - name: Run test on slim container | |
| run: docker run --rm -v "$(pwd)":/sitespeed.io --network=host sitespeedio/sitespeed.io:slim http://127.0.0.1:3001 -n 1 --browsertime.firefox.preference "devtools.netmonitor.persistlog:true" | |
| - name: Run Chrome test with config | |
| run: docker run --rm -v "$(pwd)":/sitespeed.io --network=host sitespeedio/sitespeed.io http://127.0.0.1:3001 -b chrome --config test/exampleConfig.json | |
| - name: Collect a baseline for URL | |
| run: docker run -v "$(pwd)":/sitespeed.io -v "$(pwd)":/baseline sitespeedio/sitespeed.io https://www.sitespeed.io/ -n 1 --compare.saveBaseline --compare.id start_page --compare.baselinePath /baseline | |
| - name: Compare a baseline for a URL | |
| run: docker run -v "$(pwd)":/sitespeed.io -v "$(pwd)":/baseline sitespeedio/sitespeed.io https://www.sitespeed.io/ -n 1 --compare.id start_page --compare.baselinePath /baseline | |
| test-wpr-chrome: | |
| needs: build | |
| runs-on: ${{ matrix.arch.runner }} | |
| if: ${{ !contains(github.event.head_commit.message, 'docs:') }} | |
| strategy: | |
| matrix: | |
| arch: | |
| - { platform: amd64, runner: ubuntu-24.04 } | |
| - { platform: arm64, runner: ubuntu-24.04-arm } | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Download full image | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: docker-full-${{ matrix.arch.platform }} | |
| path: /tmp | |
| - name: Load image | |
| run: docker load --input /tmp/full.tar | |
| - name: Test WebPageReplay with Chrome | |
| run: docker run --cap-add=NET_ADMIN --rm -v "$(pwd)":/sitespeed.io -e REPLAY=true -e LATENCY=100 sitespeedio/sitespeed.io https://www.sitespeed.io -n 3 -b chrome | |
| - name: Test WebPageReplay user journey with Chrome | |
| run: docker run --cap-add=NET_ADMIN --rm -v "$(pwd)":/sitespeed.io -e REPLAY=true -e LATENCY=100 sitespeedio/sitespeed.io test/prepostscripts/multiWindows.cjs -n 1 -b chrome | |
| test-wpr-firefox: | |
| needs: build | |
| runs-on: ${{ matrix.arch.runner }} | |
| if: ${{ !contains(github.event.head_commit.message, 'docs:') }} | |
| strategy: | |
| matrix: | |
| arch: | |
| - { platform: amd64, runner: ubuntu-24.04 } | |
| - { platform: arm64, runner: ubuntu-24.04-arm } | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Download full image | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: docker-full-${{ matrix.arch.platform }} | |
| path: /tmp | |
| - name: Load image | |
| run: docker load --input /tmp/full.tar | |
| - name: Test WebPageReplay with Firefox | |
| run: docker run --cap-add=NET_ADMIN --rm -v "$(pwd)":/sitespeed.io --network=host -e REPLAY=true -e LATENCY=100 sitespeedio/sitespeed.io https://www.sitespeed.io -n 3 -b firefox --browsertime.firefox.acceptInsecureCerts true |