Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat[coral]: Introduce GH action for Coral PR check #127

Merged
merged 1 commit into from
Oct 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions .github/workflows/coral-pr-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Coral PR Pipeline

on:
SmuliS marked this conversation as resolved.
Show resolved Hide resolved
pull_request:
branches:
- main
- coral
paths:
- 'coral/**'
- '.github/workflows/coral-checks.yml'

permissions:
contents: read

env:
NODE_VERSION: 16
PNPM_VERSION: 7.13.4

jobs:
static_code_analysis:
name: Static code analysis
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
SmuliS marked this conversation as resolved.
Show resolved Hide resolved
with:
persist-credentials: false

- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Setup pnpm
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd # v2.2.4
with:
version: ${{ env.PNPM_VERSION }}
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
working-directory: ./coral
run: pnpm install --frozen-lockfile

- name: Run static checks
working-directory: ./coral
run: pnpm run lint

tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
SmuliS marked this conversation as resolved.
Show resolved Hide resolved
with:
persist-credentials: false

- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Setup pnpm
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd # v2.2.4
with:
version: ${{ env.PNPM_VERSION }}
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
working-directory: ./coral
run: pnpm install --frozen-lockfile

- name: Run unittests
working-directory: ./coral
run: pnpm run test