Skip to content

Merge pull request #620 from GuillaumeGomez/wait-for-text-false #940

Merge pull request #620 from GuillaumeGomez/wait-for-text-false

Merge pull request #620 from GuillaumeGomez/wait-for-text-false #940

Workflow file for this run

on:
push:
branches: [master]
pull_request:
name: CI
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install npm dependencies
run: npm install -r
- name: Run linter
run: npm run lint
- name: Run tests
run: npm run all-test
- name: Build docker image
run: docker build -t gomezguillaume/browser-ui-test .
- name: Run GUI tests
run: docker run -v "$PWD:/data" gomezguillaume/browser-ui-test --test-folder /data/tests/full-check/ --failure-folder /data/failures --variable DOC_PATH /data/tests/html_files
deploy:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build docker image (without date nor version)
run: docker build -t gomezguillaume/browser-ui-test .
- name: Build docker image (with date)
run: docker build -t gomezguillaume/browser-ui-test:`date '+%Y-%m-%d'` .
- name: Check if docker image is needed with version
run: |
echo package_version=`grep '"version":' package.json | cut -d ':' -f 2 | cut -d '"' -f 2` >> $GITHUB_ENV
if docker manifest inspect gomezguillaume/browser-ui-test:${{env.package_version}}; then
echo "push_version=false" >> $GITHUB_ENV
else
echo "push_version=true" >> $GITHUB_ENV
fi
- name: Build docker image (with version)
if: ${{ env.push_version == 'true' }}
run: docker build -t gomezguillaume/browser-ui-test:${{env.package_version}} .
- name: Publish new docker images (normal and date)
run: |
docker push gomezguillaume/browser-ui-test
docker push gomezguillaume/browser-ui-test:`date '+%Y-%m-%d'`
- name: Publish new docker image (with version)
if: ${{ env.push_version == 'true' }}
run: docker push gomezguillaume/browser-ui-test:${{env.package_version}}