From c296f47ce1881f97caa48930891ec95d5d6d5324 Mon Sep 17 00:00:00 2001 From: Jesuye David Date: Wed, 14 Feb 2024 12:38:25 -0500 Subject: [PATCH] add new react17 github workflow --- .github/workflows/new-run-tests.yml | 43 +++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/new-run-tests.yml diff --git a/.github/workflows/new-run-tests.yml b/.github/workflows/new-run-tests.yml new file mode 100644 index 000000000..f8b03ce08 --- /dev/null +++ b/.github/workflows/new-run-tests.yml @@ -0,0 +1,43 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Run Tests + +on: [push, pull_request] + +jobs: + tests: + runs-on: macos-latest + + defaults: + run: + working-directory: . + + strategy: + matrix: + node-version: ["16.x"] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + registry-url: 'https://registry.npmjs.org' + # Skip post-install scripts here, as a malicious + # script could steal the NPM_TOKEN. + - run: npm ci --ignore-scripts + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + # `npm rebuild` will run all those post-install scripts for us. + - run: npm rebuild + - run: | + npm i \ + react@^17.0.2 \ + react-dom@^17.0.2 \ + @testing-library/react@^12.1.3 \ + @testing-library/react-hooks@^8.0.0 + npm run build + - run: npm test + env: + MAPBOX_API_KEY: ${{ secrets.MAPBOX_API_KEY }} \ No newline at end of file