Skip to content

Commit

Permalink
Replaced lodash depedency, added CD
Browse files Browse the repository at this point in the history
Updated lockfile

Replaced ci with i

npm/cli#558

Reverted to npm 6

Cannot ugprade to npm 7 due to Node 14 shipping with npm 6

Fixed scripts
  • Loading branch information
chronoDave committed May 9, 2021
1 parent 2454772 commit 91adae4
Show file tree
Hide file tree
Showing 9 changed files with 2,543 additions and 1,994 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: cd
on:
push:
branches: main
tags: '*'

jobs:
ci:
name: Install, Lint & Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Install Node
uses: actions/setup-node@v2.1.3
- name: Cache packages
uses: actions/cache@v2
with:
path: ~/.npm
key: node-${{ hashFiles('**/package-lock.json') }}
restore-keys: node-
- name: Install packages
run: npm i
- name: Lint
run: npm run lint
- name: Unit Test
run: npm run test:unit
- name: Integration Test
run: npm run test:integration

publish-npm:
needs: ci
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Install Node
uses: actions/setup-node@v2
with:
registry-url: https://registry.npmjs.org/
- name: Cache packages
uses: actions/cache@v2
with:
path: ~/.npm
key: node-${{ hashFiles('**/package-lock.json') }}
restore-keys: node-
- name: Install packages
run: npm i
- name: Publish (NPM)
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

publish-gpr:
needs: ci
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Install Node
uses: actions/setup-node@v2
with:
registry-url: https://npm.pkg.github.com/
- name: Cache packages
uses: actions/cache@v2
with:
path: ~/.npm
key: node-${{ hashFiles('**/package-lock.json') }}
restore-keys: node-
- name: Install packages
run: npm i
- name: Publish (GitHub)
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
42 changes: 12 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,26 @@
name: ci
on: [push, pull_request]
env:
WEBHOOK_URL: ${{secrets.WEBHOOK_URL}}

jobs:
ci:
name: Lint & Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache node_modules
uses: actions/cache@v2.1.3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Node
uses: actions/setup-node@v2.1.3
- name: Install Packages
run: yarn --frozen-lockfile
- name: Cache packages
uses: actions/cache@v2
with:
path: ~/.npm
key: node-${{ hashFiles('**/package-lock.json') }}
restore-keys: node-
- name: Install packages
run: npm i
- name: Lint
run: yarn lint
run: npm run lint
- name: Unit Test
run: yarn test:unit
run: npm run test:unit
- name: Integration Test
run: yarn test:integration
- name: On success
if: ${{success()}}
run: |
wget https://raw.githubusercontent.com/chronoDave/user-scripts/master/webhooks/discord_github.sh
chmod +x discord_github.sh
./discord_github.sh success
- name: On error
if: ${{failure()}}
run: |
wget https://raw.githubusercontent.com/chronoDave/user-scripts/master/webhooks/discord_github.sh
chmod +x discord_github.sh
./discord_github.sh failure
run: npm run test:integration

0 comments on commit 91adae4

Please sign in to comment.