Bump actions/upload-artifact from 4.4.3 to 4.5.0 #228
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 | |
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@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7 | |
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 }}" |