diff --git a/.github/README.md b/.github/README.md new file mode 100644 index 0000000..9a63136 --- /dev/null +++ b/.github/README.md @@ -0,0 +1,13 @@ +# GitHub Action CI/CD + +## Testing Locally + +Use: **Act** +Source: + +Running actions: + +```sh +# In Jukebox-Frontend/ +act +``` diff --git a/.github/workflows/code-linting.yml b/.github/workflows/code-linting.yml index 99a04dc..7caf065 100644 --- a/.github/workflows/code-linting.yml +++ b/.github/workflows/code-linting.yml @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index d666578..5c41d78 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -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