Skip to content

Commit

Permalink
Merge pull request #556 from IATI/node_20_upgrade
Browse files Browse the repository at this point in the history
Node 20 upgrade
  • Loading branch information
simon-20 authored Apr 18, 2024
2 parents 0a5498f + f66f66e commit e5e4101
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 55 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/develop-func-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ jobs:
sudo apt-get install libxml2-utils
- name: 'Checkout GitHub Action'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Setup Node Environment'
uses: actions/setup-node@v3.8.1
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: 'Install Dependencies with Npm'
run: |
npm i -g npm@8.19.4
npm i -g npm@^10
npm ci
- name: 'Run unit tests'
Expand All @@ -41,7 +41,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Build Docker Image'
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/develop-func-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Login via Azure CLI'
uses: azure/login@v1.4.7
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:
run: sleep 180

- name: 'Checkout GitHub Action'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Install newman'
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/prod-func-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Login via Azure CLI'
uses: azure/login@v1.4.7
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
run: sleep 300

- name: 'Checkout GitHub Action'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Install newman'
run: |
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/gallium
lts/iron
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/azure-functions/node:4.7.2.1-node16
FROM mcr.microsoft.com/azure-functions/node:4.33.1-node20

# install libxml2-utils for xmllint
RUN \
Expand All @@ -14,6 +14,6 @@ COPY . /home/site/wwwroot
# Install node_modules
WORKDIR /home/site/wwwroot
RUN \
npm i -g npm@8.19.4 && \
npm i -g npm@^10 && \
npm pkg delete scripts.prepare && \
npm ci --production
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
Summary
=======

Product | Validator API Endpoints
--- | ---
Description | Node.JS app that provides API end points to validate IATI XML files, is used by https://validator.iatistandard.org/
Website | [https://developer.iatistandard.org/](https://developer.iatistandard.org/)
Related | [IATI/validator-services](https://github.com/IATI/validator-services), [IATI/validator-web](https://github.com/IATI/validator-web)
Documentation | [https://developer.iatistandard.org/](https://developer.iatistandard.org/)
Technical Issues | https://github.com/IATI/js-validator-api/issues
Support | https://iatistandard.org/en/guidance/get-support/


# IATI JavaScript Validator API

[![Deploy_To_Dev_Function_On_Push](https://github.com/IATI/js-validator-api/actions/workflows/develop-func-deploy.yml/badge.svg)](https://github.com/IATI/js-validator-api/actions/workflows/develop-func-deploy.yml)
Expand Down Expand Up @@ -48,7 +61,7 @@ This should return a version number (change port if running directly instead of

To test the validation is working, obtain an IATI XML file, and run the following command (this is if running via the docker setup; change port to `7071` if running directly):

`curl -X POST -d @PATH_TO_IATI_XML http://localhost:8080/api/pub/validate`
`curl -X POST --data-binary @PATH_TO_IATI_XML http://localhost:8080/api/pub/validate`

You should see something like (if the file is a valid IATI file):

Expand Down
97 changes: 56 additions & 41 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"*.{js,css,md}": "prettier --write"
},
"engines": {
"node": ">=16 <17",
"npm": ">=8"
"node": "20.x.x",
"npm": "10.x.x"
},
"directories": {
"doc": "docs"
Expand Down

0 comments on commit e5e4101

Please sign in to comment.