Skip to content

Commit

Permalink
ci: organize the content of the "build-and-test" workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
FlowerEatsFish committed Aug 10, 2024
1 parent 74896a0 commit eba8bfa
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: Build and Test

on:
push:
Expand All @@ -15,27 +15,42 @@ jobs:
os: [ubuntu-22.04]
node-version: [18, 20]
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: yarn global add codecov
- run: yarn install
- run: yarn run lint
- run: yarn run build
- run: yarn test

- name: Install Codecov
run: yarn global add codecov

- name: Install dependencies
run: yarn install

- name: Lint
run: yarn run lint

- name: Build
run: yarn run build

- name: Test
run: yarn test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

slack:
name: Slack Notification
needs: build
runs-on: ubuntu-22.04
if: always()
steps:
- uses: 8398a7/action-slack@v3
- name: Send notification message
uses: 8398a7/action-slack@v3
with:
status: custom
fields: all
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Books-com-tw Crawler

[![NPM version](https://img.shields.io/npm/v/books-com-tw-crawler.svg)](https://www.npmjs.com/package/books-com-tw-crawler)
[![Actions status](https://github.com/FlowerEatsFish/books-com-tw-crawler/workflows/build/badge.svg?branch=main)](https://github.com/FlowerEatsFish/books-com-tw-crawler/actions)
[![Actions status](https://github.com/FlowerEatsFish/books-com-tw-crawler/actions/workflows/build-and-test.yml/badge.svg?branch=main)](https://github.com/FlowerEatsFish/books-com-tw-crawler/actions)
[![Codecov status](https://codecov.io/gh/FlowerEatsFish/books-com-tw-crawler/branch/main/graph/badge.svg)](https://codecov.io/gh/FlowerEatsFish/books-com-tw-crawler/commits)
[![Code style](https://img.shields.io/badge/code_style-biome-blue.svg)](https://biomejs.dev/)
[![License MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
Expand Down

0 comments on commit eba8bfa

Please sign in to comment.