From 74b990340210f69a941e3e347e16ad09832ccd05 Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Thu, 27 Jun 2024 14:48:40 -0700 Subject: [PATCH] Upgrade github actions --- .github/workflows/backport.yml | 2 +- .github/workflows/benchmark.yml | 12 ++--- .github/workflows/ci.yml | 80 ++++++++++++++++------------- .github/workflows/danger.yml | 9 ++-- .github/workflows/notes.yml | 2 +- .github/workflows/release-notes.yml | 2 +- .github/workflows/stories.yml | 15 ++---- 7 files changed, 65 insertions(+), 57 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 2750ab353e11..73efa00da5c5 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: ${{ secrets.AUTOMATED_GITHUB_PAT }} repository: signalapp/Signal-Backport-Action-Private diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 7bf582af622a..8b749adbaa6c 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -25,12 +25,12 @@ jobs: run: uname -a - name: Clone Desktop repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: '20.14.0' + node-version-file: '.nvmrc' - name: Install global dependencies run: npm install -g npm@10.2.5 @@ -39,7 +39,7 @@ jobs: - name: Cache Desktop node_modules id: cache-desktop-modules - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: node_modules key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json', 'patches/**') }} @@ -130,13 +130,13 @@ jobs: - name: Upload benchmark logs on failure if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: logs path: artifacts - name: Clone benchmark repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: 'signalapp/Signal-Desktop-Benchmarks-Private' path: 'benchmark-results' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 112cb3125750..cf675d363d1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,21 +18,15 @@ jobs: steps: - run: lsb_release -a - run: uname -a - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - name: Setup node.js + uses: actions/setup-node@v4 with: - node-version: '20.14.0' + node-version-file: '.nvmrc' - run: npm install -g npm@10.2.5 - - name: Cache Desktop node_modules - id: cache-desktop-modules - uses: actions/cache@v3 - with: - path: node_modules - key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json', 'patches/**') }} - - name: Restore cached .eslintcache and tsconfig.tsbuildinfo - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 id: cache-lint with: path: | @@ -40,6 +34,13 @@ jobs: tsconfig.tsbuildinfo key: lint-${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json', 'patches/**', '.eslintrc.js', '.eslint/**', 'tsconfig.json') }} + - name: Cache Desktop node_modules + id: cache-desktop-modules + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json', 'patches/**') }} + - name: Install Desktop node_modules if: steps.cache-desktop-modules.outputs.cache-hit != 'true' run: npm ci @@ -59,7 +60,7 @@ jobs: - run: git diff --exit-code - name: Update cached .eslintcache and tsconfig.tsbuildinfo - uses: actions/cache/save@v3 + uses: actions/cache/save@v4 if: github.ref == 'refs/heads/main' with: path: | @@ -75,19 +76,21 @@ jobs: steps: - run: uname -a - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - name: Setup node.js + uses: actions/setup-node@v4 with: - node-version: '20.14.0' + node-version-file: '.nvmrc' - run: npm install -g npm@10.2.5 - name: Cache Desktop node_modules id: cache-desktop-modules - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: node_modules key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json', 'patches/**') }} + - name: Install Desktop node_modules if: steps.cache-desktop-modules.outputs.cache-hit != 'true' run: npm ci @@ -115,7 +118,7 @@ jobs: - name: Upload artifacts on failure if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: artifacts @@ -127,20 +130,22 @@ jobs: steps: - run: lsb_release -a - run: uname -a - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - name: Setup node.js + uses: actions/setup-node@v4 with: - node-version: '20.14.0' + node-version-file: '.nvmrc' - run: sudo apt-get install xvfb - run: npm install -g npm@10.2.5 - name: Cache Desktop node_modules id: cache-desktop-modules - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: node_modules key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json', 'patches/**') }} + - name: Install Desktop node_modules if: steps.cache-desktop-modules.outputs.cache-hit != 'true' run: npm ci @@ -177,7 +182,7 @@ jobs: - name: Upload artifacts on failure if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: artifacts @@ -194,10 +199,11 @@ jobs: - run: systeminfo - run: git config --global core.autocrlf false - run: git config --global core.eol lf - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - name: Setup node.js + uses: actions/setup-node@v4 with: - node-version: '20.14.0' + node-version-file: '.nvmrc' - run: npm install -g npm@10.2.5 node-gyp@10.0.1 # Set things up so @nodert-win10-rs4 dependencies build properly @@ -208,10 +214,11 @@ jobs: - name: Cache Desktop node_modules id: cache-desktop-modules - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: node_modules key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json', 'patches/**') }} + - name: Install Desktop node_modules if: steps.cache-desktop-modules.outputs.cache-hit != 'true' run: npm ci @@ -250,7 +257,7 @@ jobs: - name: Upload artifacts on failure if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: artifacts @@ -264,10 +271,13 @@ jobs: working-directory: sticker-creator steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - name: Setup node.js + uses: actions/setup-node@v4 with: - node-version: '18.17.1' + node-version-file: '.nvmrc' + cache: 'npm' + cache-dependency-path: 'package-lock.json' - name: Install Sticker Creator node_modules run: npm ci @@ -300,12 +310,12 @@ jobs: run: uname -a - name: Clone Desktop repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: '20.14.0' + node-version-file: '.nvmrc' - name: Install global dependencies run: npm install -g npm@10.2.5 @@ -314,7 +324,7 @@ jobs: - name: Cache Desktop node_modules id: cache-desktop-modules - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: node_modules key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json', 'patches/**') }} @@ -342,7 +352,7 @@ jobs: - name: Upload mock server test logs on failure if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: logs path: artifacts diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml index 6653c464b6f2..b80ead2eb3ab 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -10,12 +10,15 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 # fetch all history - - uses: actions/setup-node@v3 + - name: Setup node.js + uses: actions/setup-node@v4 with: - node-version: '20.14.0' + node-version-file: '.nvmrc' + cache: 'npm' + cache-dependency-path: 'package-lock.json' - run: npm install -g npm@10.2.5 - name: Cache danger node_modules id: cache-desktop-modules diff --git a/.github/workflows/notes.yml b/.github/workflows/notes.yml index f467ae0f3b23..18f870aa2fce 100644 --- a/.github/workflows/notes.yml +++ b/.github/workflows/notes.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: ${{ secrets.AUTOMATED_GITHUB_PAT }} repository: signalapp/Signal-Notes-Action-Private diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml index 195f00c600c0..aea3569c6aec 100644 --- a/.github/workflows/release-notes.yml +++ b/.github/workflows/release-notes.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: ${{ secrets.AUTOMATED_GITHUB_PAT }} repository: signalapp/Signal-Release-Notes-Action-Private diff --git a/.github/workflows/stories.yml b/.github/workflows/stories.yml index 444d92621f7d..cb7785ceb856 100644 --- a/.github/workflows/stories.yml +++ b/.github/workflows/stories.yml @@ -13,21 +13,16 @@ jobs: runs-on: ubuntu-latest-8-cores timeout-minutes: 30 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - name: Setup node.js + uses: actions/setup-node@v4 with: - node-version: '20.14.0' + node-version-file: '.nvmrc' cache: 'npm' + cache-dependency-path: 'package-lock.json' - name: Install global dependencies run: npm install -g npm@10.2.5 - - name: Cache Desktop node_modules - id: cache-desktop-modules - uses: actions/cache@v3 - with: - path: node_modules - key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json', 'patches/**') }} - name: Install Desktop node_modules - if: steps.cache-desktop-modules.outputs.cache-hit != 'true' run: npm ci env: CHILD_CONCURRENCY: 1