Skip to content

reverting react-toastify update #216

reverting react-toastify update

reverting react-toastify update #216

Workflow file for this run

name: "CI and CD for Frontend"
on:
workflow_dispatch:
pull_request:
branches:
- main
permissions:
contents: read
jobs:
build:
name: "Build, Test and Publish"
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
name: "Check out repository"
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
name: "Setup node"
with:
node-version: "18"
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: |
src:
- "src/frontend/**"
- if: steps.changes.outputs.src == 'true'
name: "Install dependencies"
run: npm ci
working-directory: "src/frontend"
- if: steps.changes.outputs.src == 'true'
name: "Run pre-commit hooks"
run: |
sudo apt install pipx -y
sudo apt install shellcheck -y
pipx install pre-commit
pre-commit run --all-files
- if: steps.changes.outputs.src == 'true'
name: "Lint node files"
run: npm run lint
working-directory: "src/frontend"
- if: steps.changes.outputs.src == 'true'
name: "Run tests"
run: npm test
working-directory: "src/frontend"
- if: success() || failure()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: "Upload jest test results"
path: src/frontend/reports/jest-junit.xml
- name: "Markdown lint"
run: |
npx markdownlint-cli2 "**/*.md" --config ".github/.markdownlint.json" "#src/frontend/node_modules"
- name: "Spell check"
run: |
wget https://raw.githubusercontent.com/tbroadley/spellchecker-cli/master/dictionaries/base.txt
echo "" >> base.txt
echo "emailable" >> base.txt
echo "anonymize" >> base.txt
echo "pre-populated" >> base.txt
echo "favorability" >> base.txt
echo "Dev" >> base.txt
echo "tooltip" >> base.txt
echo "outloud" >> base.txt
echo "timebox" >> base.txt
echo "uncast" >> base.txt
echo "PRs" >> base.txt
echo "CodeCov" >> base.txt
echo "Backend" >> base.txt
echo "WIP" >> base.txt
echo "OKR" >> base.txt
echo "OKRs" >> base.txt
echo "CSV" >> base.txt
echo "GitHub" >> base.txt
echo "DevOps" >> base.txt
echo "Frontend" >> base.txt
echo "ERD" >> base.txt
echo "Changelog" >> base.txt
echo "changelog" >> base.txt
echo "ReactTable" >> base.txt
echo "README" >> base.txt
echo "OpenSSF" >> base.txt
echo "CI_Backend" >> base.txt
npx -y spellchecker-cli --config ./.github/.spellcheckerrc.yaml
- if: steps.changes.outputs.src == 'true'
name: "OpenSSF Score Card"
run: |
#!/bin/bash
set -e
docker run -e GITHUB_AUTH_TOKEN=${{ github.token }} gcr.io/openssf/scorecard:stable --repo=https://github.com/microsoft/vsts-extension-retrospectives || true
- if: steps.changes.outputs.src == 'true'
name: "Code Coverage for CodeCov"
uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a # v5.0.2
with:
name: Codecov Run
files: coverage/coverage-final.json
- if: steps.changes.outputs.src == 'true'
name: "Prepare vss-extension-dev.json"
working-directory: 'src/frontend'
run: |
cp vss-extension-dev.json.template vss-extension-dev.json
ext_file="vss-extension-dev.json"
cat <<< $(jq 'del(.baseUri)' $ext_file) > $ext_file
cat <<< $(jq ".publisher = \"enginpolat\"" $ext_file) > $ext_file
ext_info=$(npx tfx extension show --no-prompt --json --publisher "enginpolat" --extensionId "retrospective-vsts-extension-dev" --token "${{ secrets.AZURE_DEVOPS_TOKEN }}")
if [[ "$ext_info" != "null" ]]; then
version=$(jq -r '.versions[0].version' <<< "$ext_info")
cat <<< $(jq ".version = \"$version\"" $ext_file) > $ext_file
fi
cat <<< $(jq ".contributions[0].properties.name = \"Retrospectives (Dev)\"" $ext_file) > $ext_file
- if: steps.changes.outputs.src == 'true'
name: "Prepare extension package"
working-directory: 'src/frontend'
env:
REACT_APP_COLLABORATION_STATE_SERVICE_URL: ${{ secrets.BACKEND_WEBAPP }}
REACT_APP_APP_INSIGHTS_INSTRUMENTATION_KEY: ${{ secrets.AI_INSTRUMENTATION_KEY }}
run: |
npm run build:p
npm run pack:d
- if: steps.changes.outputs.src == 'true'
name: "Publish extension to dev environment"
working-directory: 'src/frontend'
run: >
npx tfx extension publish
--manifests vss-extension-dev.json
--vsix ./dist/*.vsix
--token "${{ secrets.AZURE_DEVOPS_TOKEN }}"