Skip to content

Commit

Permalink
Fix build and CI (#109)
Browse files Browse the repository at this point in the history
* Revert #93.
* Revert #99.
* Remove Go setup from CI (the test was already previously disabled in #97).
* Remove `pkg` (the test was also disabled in #97).
* Remove `prebuild` and `postbuild` npm scripts - they do not get invoked with pnpm.
* Use `pnpm` in CI.
* Update TypeScript to v4.9.3.

---

Co-authored-by: Sean Massa <[email protected]>
  • Loading branch information
TooTallNate and EndangeredMassa authored Dec 19, 2024
1 parent 2f39a1b commit c209df2
Show file tree
Hide file tree
Showing 13 changed files with 79 additions and 673 deletions.
21 changes: 6 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ jobs:
steps:
- uses: actions/checkout@v1

- uses: actions/setup-go@v2
with:
go-version: '1.13.15'

- name: Use pnpm
run: corepack enable pnpm && pnpm --version

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
Expand All @@ -38,23 +31,21 @@ jobs:
- name: Print Node.js Version
run: node --version

- name: Use pnpm
run: corepack enable pnpm && pnpm --version

- name: Install Dependencies
run: npm install
run: pnpm install
env:
CI: true

- name: Run "build" step
run: npm run build --if-present
env:
CI: true

- name: Compile Go Test Functions
run: ./test/go-build.sh
run: pnpm build
env:
CI: true

- name: Run tests
run: npm test
run: pnpm test
env:
CI: true

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ __pycache__
/test/functions/*/out
/.nyc_output
/zeit-fun-*.tgz
/pkg-invoke
/util/python/python-binaries
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ implemented are:
* `nodejs14.x` for Node.js Lambda functions using a downloaded Node v14.18.1 binary
* `python` for Python Lambda functions using the system `python` binary
* `python2.7` for Python Lambda functions using a downloaded Python v2.7.12 binary
* `python3` for Python Lambda functions using the system `python3` binary
* `python3` for Python Lambda functions using the system `python3` binary (or fallback to `python`)
* `python3.6` for Python Lambda functions using a downloaded Python v3.6.8 binary
* `python3.7` for Python Lambda functions using a downloaded Python v3.7.2 binary
* `go1.x` for Lambda functions written in Go - binary must be compiled for your platform
Expand Down
18 changes: 8 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
"license": "Apache-2.0",
"repository": "vercel/fun",
"scripts": {
"prebuild": "rimraf dist",
"build": "tsc",
"postbuild": "cpy --parents src test '!**/*.ts' dist",
"test": "echo \"Node.js version: $(node -v)\\n\" && pnpm build && jest --detectOpenHandles --verbose test/test.js",
"build": "rm -rf dist && tsc && cpy --parents src test '!**/*.ts' dist",
"test": "echo \"Node.js version: $(node -v)\\n\" && pnpm build && jest --detectOpenHandles --forceExit --runInBand --verbose dist/test/test.js",
"test-codecov": "nyc pnpm test",
"report-codecov": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
"lint:staged": "lint-staged",
"prettier": "prettier --write --single-quote './{src,test}/**/*.ts'",
"prepublishOnly": "npm run build && rm -rf dist/test"
"prepublishOnly": "pnpm run build && rm -rf dist/test"
},
"files": [
"dist/src"
Expand All @@ -38,6 +36,7 @@
"tar": "4.4.18",
"tree-kill": "1.2.2",
"uid-promise": "1.0.0",
"uuid": "3.3.2",
"xdg-app-paths": "5.1.0",
"yauzl-promise": "2.1.3"
},
Expand All @@ -47,22 +46,21 @@
"@types/generic-pool": "3.1.9",
"@types/jest": "27.0.2",
"@types/micro": "7.3.6",
"@types/node": "10.12.29",
"@types/node": "16.18.122",
"@types/node-fetch": "2.5.0",
"@types/tar": "4.0.0",
"@types/uuid": "8.3.1",
"@types/yauzl-promise": "2.1.0",
"codecov": "3.7.1",
"cpy-cli": "2.0.0",
"jest": "27.3.1",
"lint-staged": "9.2.5",
"nyc": "14.1.1",
"pkg": "4.3.7",
"pre-commit": "1.2.2",
"prettier": "1.15.3",
"rimraf": "2.6.3",
"source-map-support": "0.5.10",
"ts-jest": "27.0.7",
"typescript": "4.4.4"
"typescript": "4.9.3"
},
"pre-commit": "lint:staged",
"jest": {
Expand All @@ -83,6 +81,6 @@
},
"packageManager": "[email protected]",
"engines": {
"node": ">= 10"
"node": ">= 16"
}
}
Loading

0 comments on commit c209df2

Please sign in to comment.