Skip to content

Commit

Permalink
feat: lint, test, CI/CD, cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
cesgarpas committed Jan 12, 2021
1 parent 2ba0c14 commit 3373a84
Show file tree
Hide file tree
Showing 11 changed files with 3,713 additions and 265 deletions.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.git
.github
*Dockerfile*
*docker-compose*
node_modules
*.log
*.ps1
*.cmd
*.sh
*.sh
tests
87 changes: 87 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Check syntax
run: npm run lint
env:
CI: true
- name: Run tests
run: npm run test
env:
CI: true
- name: Generate coverage report
run: npm run coverage
env:
CI: true
- name: Coverage to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
env:
CI: true
buildProd:
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push'}}
needs: test
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: governify/render:latest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
buildTest:
if: ${{ github.ref == 'refs/heads/develop' && github.event_name == 'push' }}
needs: test
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: governify/render:develop
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.vscode

# Runtime data
pids
Expand All @@ -16,9 +17,11 @@ lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
Expand Down
12 changes: 0 additions & 12 deletions .vscode/launch.json

This file was deleted.

8 changes: 0 additions & 8 deletions .vscode/settings.json

This file was deleted.

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Governify Render
[![Node.js CI](https://github.com/governify/render/workflows/Node.js%20CI/badge.svg?branch=master)](https://github.com/governify/render/actions)
[![Coverage Status](https://coveralls.io/repos/github/governify/render/badge.svg)](https://coveralls.io/github/governify/render)
<a href="https://standardjs.com"><img src="https://img.shields.io/badge/code_style-semistandard-brightgreen.svg" alt="Standard - JavaScript Style Guide"></a>
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)

## Copyright notice

**<%= pkg.name %>** is open-source software available under the GNU General Public License (GPL) version 3 (GPL v3).
Expand Down
Loading

0 comments on commit 3373a84

Please sign in to comment.