Migrate JS to TS and Test Files to Node.js Native Test runner : Juicy-coupon-bot renovation #68
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "CI Pipeline" | |
on: | |
push: | |
branches: | |
- '*' | |
paths-ignore: | |
- '*.md' | |
- 'LICENSE' | |
tags-ignore: | |
- '*' | |
pull_request: | |
branches: | |
- master | |
paths-ignore: | |
- '*.md' | |
- 'LICENSE' | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Check out Git repository" | |
uses: actions/checkout@v2 | |
- name: "Use Node.js 20" | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20 | |
cache: npm | |
- name: "Install application" | |
run: npm install --ignore-scripts | |
- name: "Lint code" | |
run: npm run lint | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Check out Git repository" | |
uses: actions/checkout@v2 | |
- name: "Use Node.js 20" | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20 | |
cache: npm | |
- name: "Cache Node.js modules" | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.OS }}-node-${{ hashFiles('**/package.json') }} | |
restore-keys: | | |
${{ runner.OS }}-node- | |
${{ runner.OS }}- | |
- name: "Install application" | |
run: npm install | |
- name: "Execute unit tests" | |
run: npm test | |
- name: "Publish coverage to Coveralls" | |
if: github.event_name == 'push' | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: ./build/reports/coverage/lcov.info | |
notify-slack: | |
if: github.event_name == 'push' && (success() || failure()) | |
needs: | |
- lint | |
- test | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Slack workflow notification" | |
uses: Gamesight/slack-workflow-status@master | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }} |