Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Npm to Yarn #103

Merged
merged 3 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions .github/workflows/ci-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,30 @@ jobs:
with:
node-version: ${{ matrix.node }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache yarn cache
id: cache-yarn
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
${{ runner.os }}-node_modules-

- name: Install and Build
run: |
npm install
npm run build
yarn install --frozen-lockfile
yarn run build
working-directory: cassdio-web/src/main/webapp
13 changes: 8 additions & 5 deletions cassdio-web/frontend.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,32 @@ if (frontend.toBoolean()) {

node {
version = '20.15.1'
npmVersion = '9.8.0'
yarnVersion = '1.22.22'
download = true

nodeProjectDir.set(projectDir)
}

task npmInstall2(type: NpmTask) {
tasks.register('yarnInstall2', YarnTask) {
args = ['install']
}

task npmBuild(type: NpmTask, dependsOn: npmInstall2) {
tasks.register('yarnBuild', YarnTask) {
dependsOn yarnInstall2
args = ['run', 'build']
}

task copyDist(type: Copy, dependsOn: npmBuild) {
tasks.register('copyDist', Copy) {
dependsOn yarnBuild
from("${projectDir}/build") {
include '**/*'
}
into "${project.rootDir}/cassdio-web/src/main/resources/static"
includeEmptyDirs = true
}

task deleteDist(type: Delete, dependsOn: copyDist) {
tasks.register('deleteDist', Delete) {
dependsOn copyDist
delete "${projectDir}/build"
}

Expand Down
Loading
Loading