Skip to content

Commit

Permalink
Merge pull request #127 from aiven/smulis-add-gh-action-for-coral-pr-…
Browse files Browse the repository at this point in the history
…pipeline

feat[coral]: Introduce GH action for Coral PR check
  • Loading branch information
jlprat authored Oct 21, 2022
2 parents 336cb0c + d7f942b commit f814b9e
Showing 1 changed file with 102 additions and 0 deletions.
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:
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
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
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

0 comments on commit f814b9e

Please sign in to comment.