Skip to content

Commit

Permalink
Feat/test ci (#11)
Browse files Browse the repository at this point in the history
* feat: add ci
  • Loading branch information
ArthurTriis1 authored Oct 10, 2024
1 parent 9db9c46 commit d54ce2f
Show file tree
Hide file tree
Showing 4 changed files with 3,347 additions and 41 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This Action should run on each PR by verifying if they pass on lint, test and build
name: CI

on:
push:
branches-ignore:
- main

jobs:
build:
name: FastStore
timeout-minutes: 15
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'

- name: Install dependencies
run: yarn

- name: Build
run: yarn build
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This Action should run on main branch and verify lint, test, and then publish the version on npm
name: CD

on:
push:
branches:
- main

jobs:
build:
name: FastStore
timeout-minutes: 15
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'

- name: Configure CI Git User
run: |
git config user.name vtexgithubbot
git config user.email [email protected]
- name: Install dependencies
run: yarn

- name: Build
run: yarn build

- name: Lint
run: yarn lint

- name: Test
run: yarn test

- name: Publish
run: yarn release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"scripts": {
"dev": "webpack serve --mode development",
"build": "tsc --module commonjs --outDir dist/cjs & tsc --module esnext --outDir dist/esm",
"release": "lerna version patch --yes && lerna publish from-git --yes",
"test": "jest"
},
"repository": {
Expand All @@ -41,6 +42,7 @@
"babel-jest": "^29.7.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lerna": "^8.1.8",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"ts-jest": "^29.2.2",
Expand Down
Loading

0 comments on commit d54ce2f

Please sign in to comment.