-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated logic to use request.query & request.url (#20)
* Updated logic to use request.query & request.url instead of weird logic. This will allow us to modify query parameters in the middlewares easier. * Updated dependencies, and code that has changed due to those dependencies having major changes. * Updated docker image with node 16/newest alpine. * Added newer versions of node to the tests. Dropping support for Node 11, 12 & 13. * Adding step to publish to docker as now the automated builds are premium feature.
- Loading branch information
Showing
15 changed files
with
2,459 additions
and
4,011 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,71 @@ | ||
name: Publish | ||
|
||
on: | ||
release: | ||
types: | ||
- created | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
mockserver-test: | ||
name: Unit Tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
nodejs: [11, 12, 13, 14] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.nodejs }} | ||
- name: install dependencies | ||
run: yarn install | ||
- name: build and run mockserver docker | ||
run: yarn run docker-build && yarn run docker-run | ||
- name: run tests | ||
run: yarn test | ||
mockserver-test: | ||
name: Unit Tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
nodejs: [14, 16, 18, 19] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.nodejs }} | ||
- name: install dependencies | ||
run: yarn install | ||
- name: build and run mockserver docker | ||
run: yarn run docker-build && yarn run docker-run | ||
- name: run tests | ||
run: yarn test | ||
|
||
publish: | ||
needs: | ||
- mockserver-test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: set version envvar | ||
run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:11}) | ||
- name: set release version on package.json | ||
run: sed -i.bak 's/0\.0\.0/'$RELEASE_VERSION'/g' package.json | ||
- name: check package | ||
run: cat package.json | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 13 | ||
- name: install dependencies | ||
run: yarn install | ||
- name: run build | ||
run: yarn build | ||
- uses: JS-DevTools/npm-publish@v1 | ||
with: | ||
token: ${{ secrets.NPM_TOKEN }} | ||
publish-to-npm: | ||
needs: | ||
- mockserver-test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: set version envvar | ||
run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:11}) | ||
- name: set release version on package.json | ||
run: sed -i.bak 's/0\.0\.0/'$RELEASE_VERSION'/g' package.json | ||
- name: check package | ||
run: cat package.json | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16 | ||
- name: install dependencies | ||
run: yarn install | ||
- name: run build | ||
run: yarn build | ||
- uses: JS-DevTools/npm-publish@v1 | ||
with: | ||
token: ${{ secrets.NPM_TOKEN }} | ||
|
||
publish-to-docker: | ||
needs: | ||
- mockserver-test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: set version envvar | ||
run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:11}) | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- name: install dependencies | ||
run: yarn install | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: build image | ||
run: docker build -t gguridi/mockserver:version-$RELEASE_VERSION . | ||
- name: push image | ||
run: docker push -t gguridi/mockserver:version-$RELEASE_VERSION . |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"printWidth": 120, | ||
"tabWidth": 4, | ||
"trailingComma": "all" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM node:12.19.0-alpine3.12 | ||
FROM node:16-alpine3.16 | ||
|
||
ENV SERVER_FOLDER=/opt/mockserver | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,22 +26,22 @@ | |
"author": "Gorka Guridi <[email protected]>", | ||
"license": "MIT", | ||
"dependencies": { | ||
"body-parser": "^1.19.0", | ||
"commander": "^6.1.0", | ||
"express": "^4.17.1", | ||
"body-parser": "^1.20.1", | ||
"commander": "^9.4.1", | ||
"express": "^4.18.2", | ||
"header-case-normalizer": "^1.0.3", | ||
"simple-combinatorics": "^1.0.2", | ||
"winston": "^3.3.3" | ||
"winston": "^3.8.2" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.11.6", | ||
"@babel/core": "^7.11.6", | ||
"@babel/preset-env": "^7.11.5", | ||
"babel-loader": "^8.1.0", | ||
"@babel/cli": "^7.19.3", | ||
"@babel/core": "^7.19.3", | ||
"@babel/preset-env": "^7.19.3", | ||
"babel-loader": "^9.1.0", | ||
"frisby": "^2.1.3", | ||
"jest": "^26.4.2", | ||
"node-mocks-http": "^1.9.0", | ||
"supertest": "^5.0.0" | ||
"jest": "^29.3.1", | ||
"node-mocks-http": "^1.12.1", | ||
"supertest": "^6.3.1" | ||
}, | ||
"jest": { | ||
"setupFiles": [ | ||
|
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.