Skip to content

Commit

Permalink
Schedule Azure Workflow (#52)
Browse files Browse the repository at this point in the history
* Apply automatic changes

* Apply automatic changes

* Apply automatic changes

* Apply automatic changes

* Apply automatic changes

* Cleanup test coverage workflow and add Azure deployment yml (#45)

* Apply automatic changes

* Apply automatic changes

* Apply automatic changes

* Apply automatic changes

* Apply automatic changes

* Fix workflow

* Remove delete statements

* clear directory prior move

* Enable test report download

* Fix workflow

* remove force flag

* Add azure deploy yml

---------

Co-authored-by: Shubhabrata08 <[email protected]>

* Keep Azure workflow in test-coverage-artifacts branch (#47)

* Apply automatic changes

* Apply automatic changes

* Apply automatic changes

* Apply automatic changes

* Apply automatic changes

* Modify workflow

* remove unnecessary docs

* remove on push trigger

---------

Co-authored-by: Shubhabrata08 <[email protected]>

* add cron schedule

* remove docs

* remove old workflows

* fix workflow

---------

Co-authored-by: Shubhabrata08 <[email protected]>
  • Loading branch information
Shubhabrata08 and Shubhabrata08 authored Feb 8, 2024
1 parent 56243ce commit 7ddff6f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 108 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Azure Static Web Apps CI/CD

on:
schedule:
- cron: "0 0 * * *"

push:
branches:
- test-coverage-artifacts
Expand Down
46 changes: 0 additions & 46 deletions .github/workflows/azure-static-web-apps-red-sand-077904510.yml

This file was deleted.

82 changes: 20 additions & 62 deletions .github/workflows/testCoverage.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
name: "Test coverage"
on:
schedule:
- cron: "0 */8 * * *"
- cron: "0 */8 * * *"
workflow_dispatch:
inputs:
repo:
description: 'Repo to run the tests on'
description: "Repo to run the tests on"
required: true
default: "microsoft/fluentui"
branch:
description: 'Branch to run the tests on'
description: "Branch to run the tests on"
required: true
default: "master"


# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
Expand All @@ -35,6 +34,8 @@ jobs:
steps:
- name: Checkout [master]
uses: actions/checkout@v4
with:
ref: main

- name: Checkout [react-charting]
uses: actions/checkout@v4
Expand All @@ -47,7 +48,7 @@ jobs:
run: echo "$PWD" && ls

- name: Show repo1 directory
run: ls ./repo1
run: ls ./repo1

- name: Install packages
run: yarn --cwd ./tools/UnitTestApp && yarn --cwd ./repo1 && yarn --cwd ./repo1/packages/react-charting
Expand All @@ -70,15 +71,15 @@ jobs:
if: matrix.os == 'windows-latest'
run: cd ./repo1/packages/react-charting && powershell -Command "(Get-Content -Path ./config/tests.js) -replace 'PROD', 'TEST' | Set-Content -Path ./config/tests.js" && yarn jest ./src/components/VerticalBarChart --coverage --coverageDirectory ./coverage/${{matrix.os}}_VerticalBarChart --verbose --coverageReporters=html
continue-on-error: true

- name: Run the tests in macos
if: matrix.os == 'macos-latest'
run: cd ./repo1/packages/react-charting && sed -i '' 's/PROD/TEST/g' ./config/tests.js && yarn jest --coverage --coverageDirectory ./coverage/${{matrix.os}} --verbose --coverageReporters=html --coverageReporters=text > coverageReport.txt
continue-on-error: true

- name: Run the tests in ubuntu
if: matrix.os == 'ubuntu-latest'
run: cd ./repo1/packages/react-charting && sed -i 's/PROD/TEST/g' ./config/tests.js && yarn jest --coverage --coverageDirectory ./coverage/${{matrix.os}} --verbose --coverageReporters=html --coverageReporters=text > coverageReport.txt
if: matrix.os == 'ubuntu-latest'
run: cd ./repo1/packages/react-charting && sed -i 's/PROD/TEST/g' ./config/tests.js && yarn jest --coverage --coverageDirectory ./coverage/${{matrix.os}} --verbose --coverageReporters=html --coverageReporters=text > coverageReport.txt
continue-on-error: true

- name: Generate coverage file name in windows
Expand Down Expand Up @@ -159,45 +160,12 @@ jobs:
name: "coverage_VBC"
path: "./coverage/coverage_VBC"

- name: Download all artifacts to publish together
uses: actions/download-artifact@v4
with:
name: ${{env.COVERAGE_FILENAME_MACOS}}
path: './coverage/coverageFileMacOS'
- name: Download all artifacts to publish together
uses: actions/download-artifact@v4
with:
name: ${{env.COVERAGE_FILENAME_UBUNTU}}
path: "./coverage/coverageFileUbuntu"
- name: Download all artifacts to publish together
uses: actions/download-artifact@v4
with:
name: ${{env.COVERAGE_FILENAME_WINDOWS}}
path: './coverage/coverageFileWindows'
- name: Download all artifacts to publish together
uses: actions/download-artifact@v4
with:
pattern: test_coverage_*
path: "./coverage/coverageFiles"

- name: "Check coverage file"
run: cd ./coverage/coverageFiles && ls -a
- name: Rename folders
run: |
cd ./coverage
for dir in *; do
if [[ $name == *"ubuntu"* ]] && [[ $name != *"_report"* ]]; then
mv "$dir" "ubuntu"
elif [[ $name == *"macos"* ]] && [[ $name != *"_report"* ]]; then
mv "$dir" "macos"
elif [[ $name == *"VBC"* ]] && [[ $name != *"_report"* ]]; then
mv "$dir" "VBC"
elif [[ $name == *"windows"* ]] && [[ $name != *"_report"* ]]; then
mv "$dir" "windows"
fi
done
shell: bash

- name: Generate html to show the latest coverages for all os types
run: |
cd ./coverage
Expand All @@ -215,18 +183,12 @@ jobs:
- name: Directory disp
run: ls -a

- name: Checkout [main]
- name: Checkout [test-coverage-artifacts]
uses: actions/checkout@v4
with:
path: repo
ref: main

- name: Remove old artifacts
run: |
rm -rf ./repo/docs/coverageFiles
cd ./repo/docs
ls -a
shell: bash
ref: test-coverage-artifacts

- name: Rename all txt reports to md and remove unnecessary lines
run: |
cd ./coverage
Expand All @@ -253,28 +215,24 @@ jobs:
echo "$statementCovJson" > ubuntuCoverage.json
fi
done
shell: bash

- name: Change branch to test-coverage-artifacts and move new artifacts to folder
- name: Move coverage JSONs to root
run: |
mv -f ./repo/.github ./
cd repo
if [ `git branch | grep test-coverage-artifacts` ]
then
git checkout test-coverage-artifacts
git pull origin test-coverage-artifacts
else
git checkout -b test-coverage-artifacts
fi
rm -rf ./*
cd ..
mv -f ./.github ./repo/
mv -f ./coverage/* ./repo/
cd repo
ls
- uses: stefanzweifel/git-auto-commit-action@v5
with:
repository: repo
branch: test-coverage-artifacts
push_options: "--force"



deploy:
needs: push_artifacts_to_repo
runs-on: "ubuntu-latest"
Expand Down

0 comments on commit 7ddff6f

Please sign in to comment.