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

chore: install psc-package via a NPM script #3386

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
22 changes: 18 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,15 @@ jobs:
distribution: adopt
java-version: 8

- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm

- name: Setup node
uses: actions/setup-node@v2
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
Copy link

@HonkingGoose HonkingGoose Sep 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you know that setup-node comes with caching now?

Suggested change
node-version: "${{ steps.nvm.outputs.NVMRC }}"
node-version: "${{ steps.nvm.outputs.NVMRC }}"
cache: npm

Read the readme and learn more here: https://github.com/actions/setup-node#caching-packages-dependencies.

By the way setup-java comes with caching as well, but I don't know much about Java, so won't apply any suggestions here.

https://github.com/actions/setup-java#caching-packages-dependencies

Also check if the version of setup-java you're using comes with the caching capability before you turn it on for Java.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a nice new feature. Thanks for letting us know. We'll have a look and see what we might be able to refactor, because the build definition sure is long.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edalex-ian Do you want me to make an issue with the same text? That way I'm not blocking this PR, and you can track the issue that way, and follow up when you have time to work on it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That'd be great thanks @HonkingGoose. 👍

I'll go and merge this in the meantime. 😉

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See issue #3390 for the "feature request".


- uses: actions/checkout@v2

- name: Download Artefacts
Expand Down Expand Up @@ -368,6 +377,15 @@ jobs:
distribution: adopt
java-version: 8

- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm

- name: Setup node
uses: actions/setup-node@v2
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
PenghaiZhang marked this conversation as resolved.
Show resolved Hide resolved

- name: Download installer
uses: actions/download-artifact@v2
with:
Expand All @@ -388,10 +406,6 @@ jobs:
./sbt -jvm-opts autotest/.jvmopts "project autotest" \
installEquella startEquella configureInstall setupForTests

- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm

- name: Setup node
uses: actions/setup-node@v2
with:
Expand Down
1 change: 1 addition & 0 deletions autotest/IntegTester/ps/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/.psc*
/.purs*
/.psa*
/psc-package
37 changes: 37 additions & 0 deletions autotest/IntegTester/ps/install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* The Apereo Foundation licenses this file to you under the Apache License,
* Version 2.0, (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

const https = require("follow-redirects").https;
const tar = require("tar");
const shell = require("shelljs");

https.get(
`https://github.com/purescript/psc-package/releases/download/v0.6.2/linux64.tar.gz`,
(res) => {
return res.pipe(
tar.x().on("finish", () => {
if (shell.test("-f", "./psc-package/psc-package")) {
shell.mv(
"./psc-package/psc-package",
"./psc-package/psc-package.exe"
);
}
})
);
}
);
34 changes: 6 additions & 28 deletions autotest/IntegTester/ps/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions autotest/IntegTester/ps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
"name": "integ-tester",
"private": true,
"scripts": {
"install": "psc-package install",
"install": "node install.js && npm exec psc-package install",
PenghaiZhang marked this conversation as resolved.
Show resolved Hide resolved
"clean": "rm -rf node_modules/ .psc-package/ psc-package",
"build": "pulp build && parcel build --no-autoinstall --out-dir=target/www www/*.html www/*.tsx",
"dev": "pulp build && parcel watch --no-autoinstall --out-dir=../target/scala-2.12/classes/www www/*.html www/*.tsx"
},
"bin": {
"psc-package": "./psc-package/psc-package.exe"
PenghaiZhang marked this conversation as resolved.
Show resolved Hide resolved
},
"engines": {
"npm": "7.19.1"
},
Expand All @@ -25,9 +29,11 @@
"@types/react-dom": "17.0.9",
"mkdirp": "1.0.4",
"parcel-bundler": "1.12.5",
"psc-package": "4.0.1",
"pulp": "15.0.0",
"purescript": "0.12.3",
"typescript": "4.4.2"
"typescript": "4.4.2",
"follow-redirects": "^1.5.9",
"tar": "^4.4.8",
"shelljs": "^0.8.2"
PenghaiZhang marked this conversation as resolved.
Show resolved Hide resolved
}
}