Skip to content

Commit

Permalink
ci: combine test and deploy to main workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sharvit committed Sep 5, 2020
1 parent 5444749 commit e4aee29
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 137 deletions.
19 changes: 19 additions & 0 deletions .github/actions/prepare-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Prepare

description: Prepare project

inputs:
nodejs-version:
description: Nodejs version to use
required: true
default: 12.x

runs:
using: "composite"
steps:
- name: Install dependencies
shell: bash
run: yarn
- name: Build
shell: bash
run: yarn build
80 changes: 80 additions & 0 deletions .github/workflows/main-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Main Workflow

on: ["push", "pull_request"]

env:
GITHUB_NAME: "Avi Sharvit"
GITHUB_EMAIL: sharvita@gmail.com
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

jobs:

test:
runs-on: ubuntu-latest
strategy:
matrix:
nodejs-version: [10.x, 12.x, 14.x]
steps:
- name: Configure git globals
shell: bash
run: |
git config --global user.email "${GITHUB_EMAIL}"
git config --global user.name "${GITHUB_NAME}"
- name: Use Node.js ${{ matrix.nodejs-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.nodejs-version }}
- name: Checkout generator-node-mdl
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Prepare project
uses: ./.github/actions/prepare-action
- name: Lint
run: yarn lint
- name: Lint commit message
uses: wagoid/commitlint-github-action@v1
with:
configFile: .commitlintrc.json
- name: Test
run: yarn test
- name: Upload coverage report to Coveralls (Parallel)
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: nodejs-v${{ matrix.node-version }}
parallel: true

finish-coveralls:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true

deploy:
needs: test
runs-on: ubuntu-latest
steps:
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Checkout generator-node-mdl
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Prepare project
uses: ./.github/actions/prepare-action
- name: Semantic Release
run: yarn semantic-release
- name: Deploy Docs
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
40 changes: 0 additions & 40 deletions .github/workflows/release-workflow.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/testing-workflow.yml

This file was deleted.

19 changes: 10 additions & 9 deletions .github/workflows/update-starter-project-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ on:
tags:
- v*

env:
GITHUB_USERNAME: sharvit
GITHUB_NAME: "Avi Sharvit"
GITHUB_EMAIL: sharvita@gmail.com
GITHUB_WEBSITE: "https://sharvit.github.io"
PROJECT_NAME: node-mdl-starter
STARTER_GH_TOKEN: ${{ secrets.STARTER_GH_TOKEN }}
STARTER_NPM_TOKEN: ${{ secrets.STARTER_NPM_TOKEN }}
GIT_REF: $GITHUB_REF

jobs:
update-starter-project:
runs-on: ubuntu-latest
env:
GITHUB_USERNAME: sharvit
GITHUB_NAME: "Avi Sharvit"
GITHUB_EMAIL: sharvita@gmail.com
GITHUB_WEBSITE: "https://sharvit.github.io"
PROJECT_NAME: node-mdl-starter
STARTER_GH_TOKEN: ${{ secrets.STARTER_GH_TOKEN }}
STARTER_NPM_TOKEN: ${{ secrets.STARTER_NPM_TOKEN }}
GIT_REF: $GITHUB_REF
steps:
- name: Use Node.js 12
uses: actions/setup-node@v1
Expand Down
49 changes: 0 additions & 49 deletions .travis.yml

This file was deleted.

0 comments on commit e4aee29

Please sign in to comment.