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

Feature/GitHub actions #82

Merged
merged 11 commits into from
Apr 17, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Node CI

on:
pull_request:
branches: [ master ]


jobs:
test_pull_request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm ci
- run: npm test
- run: npm run build
29 changes: 29 additions & 0 deletions .github/workflows/reports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Reporsts

on: ["push", "pull_request"]

jobs:
reports:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use NodeJs
uses: actions/setup-node@v1
with:
node-version: 12
- name: Remove & re-install packages
run: |
npm ci
npm test
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
path-to-lcov: ./coverage/lcov.info # optional (default value)
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# folders
node_modules/
dist/

#coverage
coverage/
.coveralls.yml

# ide & other stuff files
.idea/
Expand Down
32 changes: 5 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,13 @@
FROM node:10 as web

WORKDIR /usr/src/app
ENV ENVIRONMENT_NAME 'production'
ENV CONTAINER_VERSION '2.0.1'

COPY package*.json ./
RUN npm install --production

COPY . .
CMD node dist/server.js

###

#FROM node:10 as demo
## Create app directory
#WORKDIR /usr/src/app
#ENV ENVIRONMENT_NAME 'production'
#ENV CONTAINER_VERSION '1.5.0'
#
## Install app dependencies
## A wildcard is used to ensure both package.json AND package-lock.json are copied
## where available (npm@5+)
#COPY package*.json ./
#RUN npm install --production
## If you are building your code for production
## RUN npm ci --only=production
##COPY . .
## Bundle app source
##RUN npm run build
#
#COPY . .
#
#CMD node dist/server.js
#ARG version
#RUN ${version}=${( npm version | grep covid19liveupdates | sed "s/'(.*?)'//g")}
#ENV CONTAINER_VERSION=${version}

COPY dist/server.js .
CMD node server.js
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Coverage Status](https://coveralls.io/repos/github/danbilokha/covid19liveupdates/badge.svg?branch=master)](https://coveralls.io/github/danbilokha/covid19liveupdates?branch=master)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't wait to see this

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

34% 👍 Even though we're testing only 1 file

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thant's because it hasn't been mocked, I suppose


# covid19liveupdates
Bot for covid19 data updates in:

Expand Down
5 changes: 0 additions & 5 deletions infrastructure/demo-release.bat

This file was deleted.

5 changes: 5 additions & 0 deletions infrastructure/prod.release.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CALL cd ..
CALL heroku container:login
CALL heroku container:push web --app=%1
CALL heroku container:release web --app=%1
CALL heroku open --app=%1
6 changes: 3 additions & 3 deletions infrastructure/release.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CALL cd ..
CALL heroku container:login
CALL heroku container:push web --app=covid19liveupdbot
CALL heroku container:release web --app=covid19liveupdbot
CALL heroku open --app=covid19liveupdbot
CALL heroku container:push web --app=%1
CALL heroku container:release web --app=%1
CALL heroku open --app=%1