From ec66e8331e54c53ab6a258d8b61fd4702fa08fd5 Mon Sep 17 00:00:00 2001 From: Steve Repsher Date: Tue, 14 Feb 2023 07:03:16 -0500 Subject: [PATCH] Make minor workflow revisions and fix dedupe precommit (#15399) --- .github/workflows/cast_deployment.yaml | 10 +++---- .github/workflows/ci.yaml | 34 ++++++++++++------------ .github/workflows/demo_deployment.yaml | 10 +++---- .github/workflows/design_deployment.yaml | 4 +-- .github/workflows/design_preview.yaml | 4 +-- lint-staged.config.js | 2 +- 6 files changed, 26 insertions(+), 38 deletions(-) diff --git a/.github/workflows/cast_deployment.yaml b/.github/workflows/cast_deployment.yaml index a3ecc20db0..63957be8b1 100644 --- a/.github/workflows/cast_deployment.yaml +++ b/.github/workflows/cast_deployment.yaml @@ -33,9 +33,7 @@ jobs: cache: yarn - name: Install dependencies - run: yarn install - env: - CI: true + run: yarn install --immutable - name: Build Cast run: ./node_modules/.bin/gulp build-cast @@ -71,9 +69,7 @@ jobs: cache: yarn - name: Install dependencies - run: yarn install - env: - CI: true + run: yarn install --immutable - name: Build Cast run: ./node_modules/.bin/gulp build-cast @@ -87,4 +83,4 @@ jobs: args: deploy --dir=cast/dist --prod env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_CAST_SITE_ID }} \ No newline at end of file + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_CAST_SITE_ID }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4df43edc3f..625ff3ddbe 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,8 +15,13 @@ env: NODE_OPTIONS: --max_old_space_size=6144 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: lint: + name: Lint and check format runs-on: ubuntu-latest steps: - name: Check out files from GitHub @@ -27,20 +32,19 @@ jobs: node-version: ${{ env.NODE_VERSION }} cache: yarn - name: Install dependencies - run: yarn install - env: - CI: true + run: yarn install --immutable + - name: Check for duplicate dependencies + run: yarn dedupe --check - name: Build resources run: ./node_modules/.bin/gulp gen-icons-json build-translations build-locale-data gather-gallery-pages - name: Run eslint - run: yarn run lint:eslint + run: yarn run lint:eslint --quiet - name: Run tsc run: yarn run lint:types - name: Run prettier run: yarn run lint:prettier - - name: Check for duplicate dependencies - run: yarn dedupe --check test: + name: Run tests runs-on: ubuntu-latest steps: - name: Check out files from GitHub @@ -51,16 +55,15 @@ jobs: node-version: ${{ env.NODE_VERSION }} cache: yarn - name: Install dependencies - run: yarn install - env: - CI: true + run: yarn install --immutable - name: Build resources run: ./node_modules/.bin/gulp build-translations build-locale-data - name: Run Tests run: yarn run test build: - runs-on: ubuntu-latest + name: Build frontend needs: [lint, test] + runs-on: ubuntu-latest steps: - name: Check out files from GitHub uses: actions/checkout@v3.3.0 @@ -70,16 +73,15 @@ jobs: node-version: ${{ env.NODE_VERSION }} cache: yarn - name: Install dependencies - run: yarn install - env: - CI: true + run: yarn install --immutable - name: Build Application run: ./node_modules/.bin/gulp build-app env: IS_TEST: "true" supervisor: - runs-on: ubuntu-latest + name: Build supervisor needs: [lint, test] + runs-on: ubuntu-latest steps: - name: Check out files from GitHub uses: actions/checkout@v3.3.0 @@ -89,9 +91,7 @@ jobs: node-version: ${{ env.NODE_VERSION }} cache: yarn - name: Install dependencies - run: yarn install - env: - CI: true + run: yarn install --immutable - name: Build Application run: ./node_modules/.bin/gulp build-hassio env: diff --git a/.github/workflows/demo_deployment.yaml b/.github/workflows/demo_deployment.yaml index d28a5ffe11..f760ad9021 100644 --- a/.github/workflows/demo_deployment.yaml +++ b/.github/workflows/demo_deployment.yaml @@ -34,9 +34,7 @@ jobs: cache: yarn - name: Install dependencies - run: yarn install - env: - CI: true + run: yarn install --immutable - name: Build Demo run: ./node_modules/.bin/gulp build-demo @@ -72,9 +70,7 @@ jobs: cache: yarn - name: Install dependencies - run: yarn install - env: - CI: true + run: yarn install --immutable - name: Build Demo run: ./node_modules/.bin/gulp build-demo @@ -88,4 +84,4 @@ jobs: args: deploy --dir=demo/dist --prod env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEMO_SITE_ID }} \ No newline at end of file + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEMO_SITE_ID }} diff --git a/.github/workflows/design_deployment.yaml b/.github/workflows/design_deployment.yaml index c9b37d605a..1803766c92 100644 --- a/.github/workflows/design_deployment.yaml +++ b/.github/workflows/design_deployment.yaml @@ -26,9 +26,7 @@ jobs: cache: yarn - name: Install dependencies - run: yarn install - env: - CI: true + run: yarn install --immutable - name: Build Gallery run: ./node_modules/.bin/gulp build-gallery diff --git a/.github/workflows/design_preview.yaml b/.github/workflows/design_preview.yaml index 607838b940..6677c65f43 100644 --- a/.github/workflows/design_preview.yaml +++ b/.github/workflows/design_preview.yaml @@ -31,9 +31,7 @@ jobs: cache: yarn - name: Install dependencies - run: yarn install - env: - CI: true + run: yarn install --immutable - name: Build Gallery run: ./node_modules/.bin/gulp build-gallery diff --git a/lint-staged.config.js b/lint-staged.config.js index d5f63c77bf..1a5df4fdc1 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -5,5 +5,5 @@ module.exports = { 'printf "%s\n" "Translation files should not be added or modified here. Instead, make the necessary modifications in src/translations/en.json. Other languages are managed externally. Please see https://developers.home-assistant.io/docs/translations/ for details." ' + files.join(" ") + " >&2 && exit 1", - "/yarn.lock": () => "yarn dedupe", + "yarn.lock": () => "yarn dedupe", };