Skip to content

Commit

Permalink
ci: add ci pipeline
Browse files Browse the repository at this point in the history
Add ci workflow that performs the following jobs: build, test, and lint.
  • Loading branch information
grantwforsythe committed Mar 5, 2024
1 parent 64bc07c commit 0c8d6f8
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Install dependencies
description: Install node and npm, then run npm install

runs:
using: composite
steps:
- name: Install Node and dependencies
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: package-lock.json

- name: Install dependencies
run: npm ci
env:
HUSKY: '0'
shell: bash
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI

on:
push:
branches:
- main
pull_request:

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install node, npm, and dependencies
uses: ./.github/actions/install-dependencies

- name: Build Packages
run: npm run build
shell: bash

test:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install node, npm, and dependencies
uses: ./.github/actions/install-dependencies

- name: Run unit tests
run: npm run test:ci
shell: bash

- name: Cypress run
uses: cypress-io/github-action@v6
with:
browser: chrome
env:
CYPRESS_AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install node, npm, and dependencies
uses: ./.github/actions/install-dependencies

- name: Lint Packages
run: npm run lint
shell: bash
1 change: 1 addition & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"builder": "@angular-devkit/build-angular:karma",
"configurations": {
"production": {
"progress": false,
"sourceMap": false,
"codeCoverage": true,
"browsers": "ChromeHeadless",
Expand Down

0 comments on commit 0c8d6f8

Please sign in to comment.