diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..3990180 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: build + +on: + pull_request: + paths: + - ".github/workflows/build.yml" + - "src/**" + - "tsconfig.json" + - "tsconfig.module.json" + - "vite.config.ts" + - "package.json" + - "package-lock.json" + +jobs: + build: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v2 + + - name: Set up Node.js v20 + uses: actions/setup-node@v4 + with: + node-version: '20.9.0' + registry-url: https://registry.npmjs.org + + # Cache the node_modules directory + - name: Set up node_modules cache + uses: actions/cache@v2 + id: node-modules-cache + with: + key: node-modules-cache-${{ hashFiles('**/package-lock.json') }} + path: '**/node_modules' + + - name: Install dependencies + if: steps.node-modules-cache.outputs.cache-hit != 'true' + run: npm ci + + - name: Run build + run: npm run build diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index fd3ff85..b1d5555 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -13,15 +13,16 @@ on: jobs: eslint: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - - name: Set up Node.js v14 - uses: actions/setup-node@v1 + - name: Set up Node.js v20 + uses: actions/setup-node@v4 with: - node-version: 14 + node-version: '20.9.0' + registry-url: https://registry.npmjs.org # Cache the node_modules directory - name: Set up node_modules cache diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f4a917..d050937 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,16 +7,16 @@ on: jobs: npm-release: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} steps: - uses: actions/checkout@v2 - - name: Set up Node.js v14 - uses: actions/setup-node@v2 + - name: Set up Node.js v20 + uses: actions/setup-node@v4 with: - node-version: 14 + node-version: '20.9.0' registry-url: https://registry.npmjs.org # Cache the node_modules directory @@ -40,14 +40,14 @@ jobs: github-release: needs: npm-release - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - - name: Set up Node.js v14 - uses: actions/setup-node@v1 + - name: Set up Node.js v20 + uses: actions/setup-node@v4 with: - node-version: 14 + node-version: '20.9.0' # Cache the node_modules directory - name: Set up node_modules cache diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..c06d2e1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,41 @@ +name: test + +on: + pull_request: + paths: + - ".github/workflows/test.yml" + - "src/**" + - "tsconfig.build.json" + - "tsconfig.json" + - "tsconfig.module.json" + - "vite.config.ts" + - "package.json" + - "package-lock.json" + +jobs: + vitest: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v2 + + - name: Set up Node.js v20 + uses: actions/setup-node@v4 + with: + node-version: '20.9.0' + registry-url: https://registry.npmjs.org + + # Cache the node_modules directory + - name: Set up node_modules cache + uses: actions/cache@v2 + id: node-modules-cache + with: + key: node-modules-cache-${{ hashFiles('**/package-lock.json') }} + path: '**/node_modules' + + - name: Install dependencies + if: steps.node-modules-cache.outputs.cache-hit != 'true' + run: npm ci + + - name: Run tests + run: npm run test diff --git a/package-lock.json b/package-lock.json index a118509..d46c90e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@fintoc/fintoc-react-native", - "version": "1.0.1", + "version": "1.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@fintoc/fintoc-react-native", - "version": "1.0.1", + "version": "1.0.2", "license": "MIT", "devDependencies": { - "@types/node": "^18.19.31", + "@types/node": "^20.9.0", "@types/react": "^17.0.33", "@types/react-native": "^0.67.3", "@typescript-eslint/eslint-plugin": "^5.16.0", @@ -3501,9 +3501,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.19.31", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.31.tgz", - "integrity": "sha512-ArgCD39YpyyrtFKIqMDvjz79jto5fcI/SVUs2HwB+f0dAzq68yqOdyaSivLiLugSziTpNXLQrVb7RZFmdZzbhA==", + "version": "20.12.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.11.tgz", + "integrity": "sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -15767,9 +15767,9 @@ "dev": true }, "@types/node": { - "version": "18.19.31", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.31.tgz", - "integrity": "sha512-ArgCD39YpyyrtFKIqMDvjz79jto5fcI/SVUs2HwB+f0dAzq68yqOdyaSivLiLugSziTpNXLQrVb7RZFmdZzbhA==", + "version": "20.12.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.11.tgz", + "integrity": "sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==", "dev": true, "requires": { "undici-types": "~5.26.4" diff --git a/package.json b/package.json index 6e526bd..2256a6f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fintoc/fintoc-react-native", - "version": "1.0.1", + "version": "1.0.2", "repository": "https://github.com/fintoc-com/fintoc-react-native", "license": "MIT", "author": { @@ -16,6 +16,9 @@ "import": "./dist/main.es.js" } }, + "files": [ + "dist" + ], "scripts": { "bump!": "sh scripts/bump.sh", "build": "run-p build:*", @@ -32,7 +35,7 @@ "react-native-webview": "*" }, "devDependencies": { - "@types/node": "^18.19.31", + "@types/node": "^20.9.0", "@types/react": "^17.0.33", "@types/react-native": "^0.67.3", "@typescript-eslint/eslint-plugin": "^5.16.0",