diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2022-04-22 15:12:42 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2022-04-25 11:31:47 +0200 |
| commit | 273a9f4634acbb87e83785c2c480b33ca72daf9e (patch) | |
| tree | fb9c1987733d6eefce053dc9302838cd17a6cf46 /.github/workflows | |
| parent | 410965e0ba1ec6a59dea1e128822dd545cd58ab8 (diff) | |
| download | mullvadvpn-273a9f4634acbb87e83785c2c480b33ca72daf9e.tar.xz mullvadvpn-273a9f4634acbb87e83785c2c480b33ca72daf9e.zip | |
Switch to volta in actions and add npm cache
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/frontend.yml | 24 | ||||
| -rw-r--r-- | .github/workflows/translations.yml | 21 |
2 files changed, 26 insertions, 19 deletions
diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index d31c55509f..6cd1e415c6 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -16,21 +16,23 @@ jobs: runs-on: ${{ matrix.os }} steps: - # Prevent conversion of line-breaks on Windows - - run: git config --global core.autocrlf input - - name: Checkout repository uses: actions/checkout@v2 - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version-file: '.nvmrc' - cache: 'npm' - cache-dependency-path: gui/package-lock.json + - name: Setup volta + uses: volta-cli/action@v1 - - name: Update NPM - run: npm i -g npm + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm config get cache)" + + - name: Cache npm dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-npm- - name: Install dependencies working-directory: gui diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml index 8bdf3a747a..08a0cf91b2 100644 --- a/.github/workflows/translations.yml +++ b/.github/workflows/translations.yml @@ -16,15 +16,20 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version-file: '.nvmrc' - cache: 'npm' - cache-dependency-path: gui/package-lock.json + - name: Setup volta + uses: volta-cli/action@v1 + + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm config get cache)" - - name: Update NPM - run: npm i -g npm + - name: Cache npm dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-npm- - name: Install JS dependencies working-directory: gui |
