Skip to content

Commit

Permalink
add ci readme, add code cov support for badge
Browse files Browse the repository at this point in the history
  • Loading branch information
IkeHunter committed Oct 9, 2024
1 parent c4b31f3 commit ef84feb
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# GitHub Action CI/CD

## Testing Locally

Use: **Act**
Source: <https://www.freecodecamp.org/news/how-to-run-github-actions-locally/>

Running actions:

```sh
# In Jukebox-Frontend/
act
```
6 changes: 6 additions & 0 deletions .github/workflows/code-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Node.js Setup
uses: actions/setup-node@v3
- name: Install Packages
run: npm ci
- name: Build Vite & TSC
Expand All @@ -22,6 +24,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Node.js Setup
uses: actions/setup-node@v3
- name: Install Packages
run: npm ci
- name: Run Eslint
Expand All @@ -32,6 +36,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Node.js Setup
uses: actions/setup-node@v3
- name: Install Packages
run: npm ci
- name: Run Prettier
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Node.js Setup
uses: actions/setup-node@v3
- name: Install Packages
run: npm ci
- name: Run Tests
run: npm run test
- name: Update Coverage Badge
# GitHub actions: default branch variable
# https://stackoverflow.com/questions/64781462/github-actions-default-branch-variable
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
uses: we-cli/coverage-badge-action@main

0 comments on commit ef84feb

Please sign in to comment.