Skip to content
Merged
Show file tree
Hide file tree
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
46 changes: 0 additions & 46 deletions .circleci/config.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/actions/npminstall/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Install node and dependencies"
description: "Installs node and dependencies with npm ci"
inputs:
NODE_VERSION_FILE:
description: "Location of the .nvmrc file"
required: true
runs:
using: composite
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v4
with:
node-version-file: ${{ inputs.NODE_VERSION_FILE }}
- name: Install
shell: bash
run: npm ci
67 changes: 67 additions & 0 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
name: CICD
on:
pull_request:
branches: [main]
push:
branches: [main]
env:
NODE_VERSION_FILE: ".nvmrc"
jobs:
build-lint-format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Node and dependencies
uses: ./.github/actions/npminstall
with:
node-version-file: ${{ env.NODE_VERSION_FILE }}
- name: Build with ts
run: npm run build
- name: Lint
run: npm run lint
- name: Format
run: npm run format
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
run: docker build -t code-review-exercise-node:${{ github.sha }} .
gitleaks:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run Gitleaks
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}
snyk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/[email protected]
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: monitor
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Node and dependencies
uses: ./.github/actions/npminstall
with:
node-version-file: ${{ env.NODE_VERSION_FILE }}
- name: Test
run: npm run test
Loading