Skip to content

Commit

Permalink
chore: try building typescript project in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbinoDrought committed Aug 3, 2022
1 parent 3c88ce0 commit cbd82a1
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/typescript-compat.yml
@@ -0,0 +1,22 @@
name: Typescript Compat

on: [push]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- run: npm ci
- name: Try Building Typescript Project
run: cd tests/integration/cachios-typescript && npm install && npm install "axios@latest" --no-save && npm run build
3 changes: 3 additions & 0 deletions tests/integration/cachios-typescript/.gitignore
@@ -0,0 +1,3 @@
package-lock.json
node-modules
out
10 changes: 10 additions & 0 deletions tests/integration/cachios-typescript/index.ts
@@ -0,0 +1,10 @@
import axios from 'axios';
import cachios from 'cachios';

(async () => {
const axiosInstance = axios.create({});
const cachiosInstance = cachios.create(axiosInstance);

const resp = await cachiosInstance.get('http://localhost');
console.log(resp.data);
})();
14 changes: 14 additions & 0 deletions tests/integration/cachios-typescript/package.json
@@ -0,0 +1,14 @@
{
"name": "cachios-typescript",
"scripts": {
"build": "rm -rf out && tsc -p ./"
},
"devDependencies": {
"@types/node": "^16.10.3",
"typescript": "^4.7.4"
},
"dependencies": {
"axios": "^0.27.2",
"cachios": "file:../../../"
}
}
17 changes: 17 additions & 0 deletions tests/integration/cachios-typescript/tsconfig.json
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"lib": [
"es6",
"DOM"
],
"sourceMap": true,
"rootDir": "."
},
"exclude": [
"node_modules",
".vscode-test"
]
}

0 comments on commit cbd82a1

Please sign in to comment.