Skip to content

Fix exception caused by attempting to redact very short tokens #1536

Fix exception caused by attempting to redact very short tokens

Fix exception caused by attempting to redact very short tokens #1536

Workflow file for this run

name: Web API / CI
on:
push:
workflow_dispatch:
jobs:
build:
name: Build and test
runs-on: ubuntu-22.04
env:
WEB_PROJECT_PATH: src/Buttercup.Web
services:
redis:
image: redis
ports:
- 6379:6379
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.1xx
dotnet-quality: ga
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: ${{env.WEB_PROJECT_PATH}}/package-lock.json
- name: Set SHORT_COMMIT_SHA
run: echo "SHORT_COMMIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Restore .NET tools
run: dotnet tool restore
- name: Restore Node.js dependencies
run: npm ci
working-directory: ${{env.WEB_PROJECT_PATH}}
- name: Build .NET solution
run: dotnet build --configuration Release /WarnAsError
- name: Build assets
run: npx gulp build
working-directory: ${{env.WEB_PROJECT_PATH}}
- name: Start MySQL Server
run: sudo systemctl start mysql.service
- name: Create MySQL user
run: mysql -uroot -proot < scripts/create-dev-user.sql
- name: Run .NET tests
run: dotnet test --no-build --configuration Release --collect "XPlat Code Coverage"
- name: Report .NET test coverage
if: ${{ hashFiles('**/coverage.cobertura.xml') }}
run: |
./scripts/build-dotnet-coverage-report.sh -reporttypes:TextSummary
cat coverage/Summary.txt
- name: Run Jest tests
run: npx jest --coverage
working-directory: ${{env.WEB_PROJECT_PATH}}
- name: Install Playwright browsers
run: npx playwright install --with-deps
working-directory: ${{env.WEB_PROJECT_PATH}}
- name: Run Playwright tests
run: npx playwright test
working-directory: ${{env.WEB_PROJECT_PATH}}
- name: Check formatting
run: npx prettier -c .
working-directory: ${{env.WEB_PROJECT_PATH}}
- name: Lint scripts
run: npx eslint .
working-directory: ${{env.WEB_PROJECT_PATH}}
- name: Lint styles
run: npx stylelint --max-warnings 0 styles/
working-directory: ${{env.WEB_PROJECT_PATH}}
- name: Publish
run: dotnet publish Buttercup.Web.csproj --no-build --no-restore --configuration Release --output publish-output
working-directory: ${{env.WEB_PROJECT_PATH}}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: buttercup-web-${{env.SHORT_COMMIT_SHA}}
path: ${{env.WEB_PROJECT_PATH}}/publish-output
retention-days: 3