fronted for dataview key value length search #14
Workflow file for this run
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-Frontend | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- '.github/workflows/CI-Frontend.yml' | |
- 'frontend/**' | |
pull_request: | |
branches: [ main ] | |
paths: | |
- '.github/workflows/CI-Frontend.yml' | |
- 'frontend/**' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: frontend | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: List files | |
run: ls -la | |
- name: Detect package manager | |
id: detect-package-manager | |
run: | | |
if [ -f "${PWD}/yarn.lock" ]; then | |
echo "::set-output name=manager::yarn" | |
echo "::set-output name=command::install" | |
echo "::set-output name=runner::yarn" | |
exit 0 | |
elif [ -f "${PWD}/package.json" ]; then | |
echo "::set-output name=manager::npm" | |
echo "::set-output name=command::ci" | |
echo "::set-output name=runner::npx --no-install" | |
exit 0 | |
else | |
echo "Unable to determine packager manager" | |
exit 1 | |
fi | |
- name: Debug List Files in Current Directory | |
run: ls -la ${PWD} | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
cache: ${{ steps.detect-package-manager.outputs.manager }} | |
cache-dependency-path: frontend/package-lock.json | |
- name: Cache Next.js build | |
uses: actions/cache@v3 | |
with: | |
path: .next/cache | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} | |
restore-keys: | | |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- | |
- name: Install dependencies | |
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} | |
- name: Build with Next.js | |
run: npm run build | |
semgrep: | |
name: Semgrep | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: frontend | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Detect package manager | |
id: detect-package-manager | |
run: | | |
if [ -f "${PWD}/yarn.lock" ]; then | |
echo "::set-output name=manager::yarn" | |
echo "::set-output name=command::install" | |
echo "::set-output name=runner::yarn" | |
exit 0 | |
elif [ -f "${PWD}/package.json" ]; then | |
echo "::set-output name=manager::npm" | |
echo "::set-output name=command::ci" | |
echo "::set-output name=runner::npx --no-install" | |
exit 0 | |
else | |
echo "Unable to determine packager manager" | |
exit 1 | |
fi | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
cache: ${{ steps.detect-package-manager.outputs.manager }} | |
cache-dependency-path: frontend/package-lock.json | |
- name: semgrep | |
run: docker run --rm -v "${PWD}:/src" returntocorp/semgrep semgrep ci --config "p/react" --no-suppress-errors | |