From 29f763afbb1519d0eb03c1e0e2b81fc1ac1d7db7 Mon Sep 17 00:00:00 2001 From: Decio Ferreira Date: Tue, 17 Sep 2024 17:58:07 +0100 Subject: [PATCH] closes #21 Add CI for tests and elm-review --- .github/workflows/main.yml | 26 ++++++++++++++++++++++++++ README.md | 4 ++-- package.json | 5 +++-- 3 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..b04c1edc4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,26 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests for the configured nvm version of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: CI + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + cache: "npm" + - run: npm ci + - run: npm run build + - run: npm test + - run: npm run elm-test + - run: npm run elm-review diff --git a/README.md b/README.md index fa8d07036..1930680fb 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ npm install Generate guida: ``` -npm start +npm run build ``` Link the project to run `guida` command: @@ -80,7 +80,7 @@ You can then `open index.html`. To clear all cache and re-generate `./bin/guida.js` run the following: ``` -rm -rf ~/.guida guida-stuff; npm start +rm -rf ~/.guida guida-stuff; npm run build ``` # Run tests diff --git a/package.json b/package.json index 7c430a1c4..b84cc808a 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,10 @@ "guida": "./bin/index.js" }, "scripts": { - "start": "./lib/guida.js", + "build": "./lib/guida.js", "test": "jest", - "elm-test": "elm-test" + "elm-test": "elm-test", + "elm-review": "elm-review" }, "dependencies": { "adm-zip": "^0.5.15",