Skip to content

Run API test and publish report #35

Run API test and publish report

Run API test and publish report #35

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Run API test and publish report
on:
push:
branches: [ master ]
jobs:
APIAutomationBuild:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 14.17.6
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build Docker image
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
load: true
tags: api-node-image:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Run api test in docker
run: docker run --volume "${pwd}"/report:/app/report/ api-node-image:latest
- name: Upload report artifact
uses: actions/upload-artifact@v2
with:
name: MochawesomeReport
path: /report
# - name: Deploy report to GitHub Page
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# PUBLISH_BRANCH: gh-pages
# PUBLISH_DIR: ./report