Merge pull request #12 from socotecio/changeCiSystem #2
This file contains hidden or 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 | |
on: | |
push: | |
branches: [ main, next ] | |
pull_request: | |
branches: [ main, next ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.11.1' | |
- name: Install dependencies | |
run: npm install | |
- name: Run unit tests | |
run: npm run test:unit | |
release: | |
# This job will only run on pushes to main or next, and after the test job completes successfully. | |
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next' | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.11.1' | |
- name: Install dependencies | |
run: npm install | |
- name: Build project | |
run: npm run build | |
- name: Semantic release | |
run: npx semantic-release |