accounts/.github/workflows/code-analysis.yml

53 lines
1.3 KiB
YAML

name: Code Analysis
on:
workflow_call:
pull_request:
branches: [main]
workflow_dispatch:
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install git-secrets
run: |
git clone https://github.com/awslabs/git-secrets.git
sudo make install -C git-secrets
git secrets --install
git secrets --scan
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Vet
run: go vet ./...
- name: Run tests
run: go test ./...
dashboard-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
cache-dependency-path: dashboard/yarn.lock
- name: Install dashboard dependencies
working-directory: dashboard
run: yarn install --frozen-lockfile
- name: Install Playwright browsers
working-directory: dashboard
run: npx playwright install --with-deps chromium
- name: Run unit tests
working-directory: dashboard
run: yarn test:unit
- name: Run end-to-end tests
working-directory: dashboard
env:
PORT: 3100
run: yarn test:e2e