From c88a8f2f0edf66b00ba20a678479cb676f3346c8 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Mon, 18 Jan 2021 10:14:44 +0200 Subject: [PATCH] Update CI config (#3308) * remove `CI: true` since it's set by the runner * update to `actions/setup-node@v2` * switch to `ruby/setup-ruby` Action * specify `FORCE_COLOR: 2` * lowercase `runner.os` * update to Ruby 2.7 * update to Node.js 14.x * fix npm cache mismatches due to wrong variable --- .github/workflows/ci.yml | 12 ++++----- .github/workflows/docs.yml | 53 ++++++++++++-------------------------- .github/workflows/lint.yml | 12 ++++----- 3 files changed, 29 insertions(+), 48 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f1235147d..b55a36823 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ on: - "**" env: - CI: true + FORCE_COLOR: 2 jobs: run: @@ -32,7 +32,7 @@ jobs: uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: node-version: ${{ matrix.node }} @@ -45,10 +45,10 @@ jobs: uses: actions/cache@v2 with: path: ${{ steps.npm-cache.outputs.dir }} - key: ${{ runner.os }}-node-v${{ env.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}} + key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}} restore-keys: | - ${{ runner.OS }}-node-v${{ env.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }} - ${{ runner.OS }}-node-v${{ env.node }}- + ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }} + ${{ runner.os }}-node-v${{ matrix.node }}- - name: Install npm dependencies run: npm ci @@ -58,6 +58,6 @@ jobs: - name: Run bundlewatch run: npm run bundlewatch - if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.node, '12') + if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.node, '14') env: BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a82082d3f..840b45aeb 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -9,9 +9,9 @@ on: - "**" env: - CI: true - NODE: 12.x - RUBY: 2.6.x + FORCE_COLOR: 2 + NODE: 14.x + RUBY: 2.7 jobs: run: @@ -22,55 +22,36 @@ jobs: uses: actions/checkout@v2 - name: Set up Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: node-version: "${{ env.NODE }}" - name: Set up Ruby - uses: actions/setup-ruby@v1 + uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ env.RUBY }} + ruby-version: "${{ env.RUBY }}" + bundler-cache: true + working-directory: docs - - name: Disable gem docs - run: 'echo "gem: --no-document" > ~/.gemrc' - - - name: Get npm cache directory - id: npm-cache + - name: Version info run: | - echo "::set-output name=dir::$(npm config get cache)" + ruby --version + gem --version + bundle --version + java -version - name: Set up npm cache uses: actions/cache@v2 with: - path: ${{ steps.npm-cache.outputs.dir }} - key: ${{ runner.os }}-node-v${{ env.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}} + path: ~/.npm + key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}} restore-keys: | - ${{ runner.OS }}-node-v${{ env.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }} - ${{ runner.OS }}-node-v${{ env.node }}- - - - name: Set up Ruby cache - uses: actions/cache@v2 - with: - path: docs/vendor/bundle - key: ${{ runner.os }}-ruby-v${{ env.RUBY }}-${{ hashFiles('docs/Gemfile') }}-${{ hashFiles('docs/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-ruby-v${{ env.RUBY }}-${{ hashFiles('docs/Gemfile') }}-${{ hashFiles('docs/Gemfile.lock') }} - ${{ runner.os }}-ruby-v${{ env.RUBY }}- - - - name: Set up Bundler - run: gem install bundler -v "~> 1.17" - - - run: ruby --version - - run: gem --version - - run: bundle --version - - run: java -version + ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }} + ${{ runner.os }}-node-v${{ env.NODE }}- - name: Install npm dependencies run: npm ci - - name: Install bundler dependencies - run: bundle install --gemfile docs/Gemfile --deployment --jobs=4 --retry=3 --clean - - name: Build docs run: npm run docs-compile diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9865dabd6..d302b2e99 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,8 +9,8 @@ on: - "**" env: - CI: true - NODE: 12.x + FORCE_COLOR: 2 + NODE: 14.x jobs: run: @@ -21,7 +21,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: node-version: "${{ env.NODE }}" @@ -29,10 +29,10 @@ jobs: uses: actions/cache@v2 with: path: ~/.npm - key: ${{ runner.os }}-node-v${{ env.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}} + key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}} restore-keys: | - ${{ runner.OS }}-node-v${{ env.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }} - ${{ runner.OS }}-node-v${{ env.node }}- + ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }} + ${{ runner.os }}-node-v${{ env.NODE }}- - name: Install npm dependencies run: npm ci