From 596d3862c57cbc12da78536a9fcb0ad847c28c22 Mon Sep 17 00:00:00 2001 From: tangoyankee Date: Fri, 27 Sep 2024 14:29:31 -0400 Subject: [PATCH] Run code quality checks on pull requests Make a workflow specific to code quality checks that runs on pull requests Fix errors causing code quality checks to fail closes #1272 --- .github/workflows/code-quality.yml | 27 +++++++++++++++++++++++++++ client/config/environment.js | 24 ++++++++++++------------ 2 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/code-quality.yml diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml new file mode 100644 index 00000000..06553e75 --- /dev/null +++ b/.github/workflows/code-quality.yml @@ -0,0 +1,27 @@ +name: 🚧 Check code quality +on: + pull_request: + +jobs: + test-client: + name: 🧪 Test client code + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + sparse-checkout: client + - uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: install dependencies + run: yarn install --frozen-lockfile --non-interactive + working-directory: client + - name: build + env: + DISABLE_SOURCE_MAPS: true + BROCCOLI_ENV: production + run: yarn build + working-directory: client + - name: test + run: yarn test + working-directory: client diff --git a/client/config/environment.js b/client/config/environment.js index cd98d15c..047e0935 100644 --- a/client/config/environment.js +++ b/client/config/environment.js @@ -1,9 +1,9 @@ module.exports = function(environment) { const ENV = { - modulePrefix: "client", + modulePrefix: 'client', environment, - rootURL: "/", - locationType: "auto", + rootURL: '/', + locationType: 'auto', host: getHost(environment), NYCIDDomain: getOAuthDomain(environment), NYCIDLocation: getOAuthLoginEndpoint(environment), @@ -22,9 +22,9 @@ module.exports = function(environment) { }, fontawesome: { icons: { - "free-brands-svg-icons": "all", - "free-regular-svg-icons": "all", - "free-solid-svg-icons": "all", + 'free-brands-svg-icons': 'all', + 'free-regular-svg-icons': 'all', + 'free-solid-svg-icons': 'all', }, }, @@ -33,10 +33,10 @@ module.exports = function(environment) { // when it is created }, - "labs-search": { - host: "https://search-api-production.herokuapp.com", - route: "search", - helpers: ["geosearch-v2", "bbl"], + 'labs-search': { + host: 'https://search-api-production.herokuapp.com', + route: 'search', + helpers: ['geosearch-v2', 'bbl'], }, }; @@ -142,6 +142,6 @@ function getMaintenanceTimes() { return [MAINTENANCE_START, MAINTENANCE_END]; } -function getFeatureFlagSelfService() { - return process.env.FEATURE_FLAG_SELF_SERVICE === "ON"; +function getFeatureFlagSelfService() { + return process.env.FEATURE_FLAG_SELF_SERVICE === 'ON'; }