feat: add github action #1
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 Workflow | |
on: | |
push: | |
branches: | |
- '*' # Runs on all branches | |
pull_request: | |
branches: | |
- '*' # Runs on pull requests to any branch | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the code | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Step 2: Set up Node.js | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'yarn' | |
# Step 3: Install Yarn Berry | |
- name: Install Yarn Berry | |
run: yarn set version berry | |
# Step 4: Install dependencies | |
- name: Install dependencies | |
run: yarn install | |
# Step 5: Run the build script | |
- name: Build the project | |
run: yarn run build | |
# Step 6: Run tests | |
- name: Run tests | |
run: yarn run test |