From b3cdaf07a374cc3e8e80e7185e86a00b7f787bb3 Mon Sep 17 00:00:00 2001 From: Anush Gupta <74965306+Anush2303@users.noreply.github.com> Date: Sat, 25 Jan 2025 06:15:16 +0000 Subject: [PATCH] Add github workflow for plotly testing --- .github/workflows/plotlytestCoverage.yml | 80 ++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflows/plotlytestCoverage.yml diff --git a/.github/workflows/plotlytestCoverage.yml b/.github/workflows/plotlytestCoverage.yml new file mode 100644 index 0000000000..f61c8e6492 --- /dev/null +++ b/.github/workflows/plotlytestCoverage.yml @@ -0,0 +1,80 @@ +name: "Plotly Test coverage" +on: + schedule: + - cron: "0 */8 * * *" + workflow_dispatch: + inputs: + repo: + description: "Repo to run the tests on" + required: true + default: "microsoft/fluentui" + branch: + description: "Branch to run the tests on" + required: true + default: "master" + +#Set permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: write + pages: write + id-token: write + +jobs: + run_tests: + strategy: + matrix: + os: [windows-latest] + runs-on: ${{matrix.os}} + outputs: + test_coverage: ${{steps.run_tests.outputs}} + windows_artifact_name: ${{ steps.windows.outputs.COVERAGE_FILENAME_WINDOWS}} + + steps: + - name: Checkout [master] + uses: actions/checkout@v4 + + - name: Checkout [react-charting] + uses: actions/checkout@v4 + with: + repository: ${{ github.event.inputs.repo || 'microsoft/fluentui'}} + ref: ${{ github.event.inputs.branch || 'master'}} + path: repo1 + + - name: Show current directory + run: echo "$PWD" && ls + + - name: Show repo1 respository + run: ls ./repo1 + + - name: Install packgaes + run: yarn --cwd ./repo1 && yarn --cwd ./repo1/packages/charts/react-charting + + - name: Build + run: yarn --cwd ./repo1 buildto @fluentui/react-charting + + - name: Run yarn pack to create .tgz file + run: | + cd ./repo1/packages/charts/react-charting + yarn pack --filename react-charting.tgz + id: pack + + - name: Install .tgz file in Plotly examples + run: | + cd apps/plotly_examples + rm -rf node_modules + yarn install + yarn add ../rep1/packages/charts/react-charting/react-charting.tgz + yarn install + + - name: Locally run the test app + run: | + cd apps/plotly_examples + npm start + + - name: Run playwright test script + run: | + cd apps/plotly_examples + npx cross-env BASE_URL='http://localhost:3000/' npx playwright test + + + \ No newline at end of file