Skip to content

Commit

Permalink
Switch to pnpm (#305)
Browse files Browse the repository at this point in the history
* Switch to pnpm

* maybe fix

* maybe fix

* Oops, no cjs

* Fix tests
  • Loading branch information
hhvrc authored Oct 21, 2024
1 parent 453d584 commit 92b1914
Show file tree
Hide file tree
Showing 17 changed files with 3,303 additions and 5,136 deletions.
34 changes: 29 additions & 5 deletions .github/actions/build-frontend/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: build-frontend
description: Builds the frontend and uploads it as an artifact
inputs:
pnpm-version:
description: 'pnpm version to use'
required: true
node-version:
description: 'NodeJS runtime version to use'
required: true
Expand All @@ -18,21 +21,42 @@ runs:
frontend
path: ${{ github.repository }}

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: ${{ inputs.pnpm-version }}
run_install: false

- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'npm'
cache-dependency-path: ./frontend/package-lock.json
node-version-file: ./frontend/.nvmrc
cache: 'pnpm'
cache-dependency-path: ./frontend/pnpm-lock.yaml

- name: Install dependencies
working-directory: ./frontend
shell: bash
run: npm ci
run: pnpm install --frozen-lockfile --strict-peer-dependencies

- name: Check
working-directory: ./frontend
shell: bash
run: pnpm run check

- name: Install playwright
working-directory: ./frontend
shell: bash
run: pnpx playwright install --with-deps

- name: Test
working-directory: ./frontend
shell: bash
run: pnpm test

- name: Build
working-directory: ./frontend
shell: bash
run: npm run build
run: pnpm run build

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
10 changes: 5 additions & 5 deletions .github/scripts/get-vars.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const fs = require('fs');
const ini = require('ini');
const semver = require('semver');
const core = require('@actions/core');
const child_process = require('child_process');
import fs from 'fs';
import ini from 'ini';
import semver from 'semver';
import core from '@actions/core';
import child_process from 'child_process';

// Get branch name
const gitRef = process.env.GITHUB_REF;
Expand Down
253 changes: 0 additions & 253 deletions .github/scripts/package-lock.json

This file was deleted.

12 changes: 9 additions & 3 deletions .github/scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
{
"name": "get-variables",
"version": "1.0.0",
"description": "",
"private": true,
"type": "module",
"main": "src/index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"ini": "^5.0.0",
"semver": "^7.6.0"
},
"engines": {
"node": ">=20.18",
"pnpm": ">=9"
},
"volta": {
"node": "20.18.0"
}
}
Loading

0 comments on commit 92b1914

Please sign in to comment.