Skip to content

Commit

Permalink
fix eslint warnings, remove jest not used
Browse files Browse the repository at this point in the history
  • Loading branch information
vemonet committed Jul 22, 2023
1 parent 42375b0 commit 5842e6b
Show file tree
Hide file tree
Showing 7 changed files with 2,011 additions and 5,148 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:

test-setup-spark:
name: Test setup Spark
name: Run setup Spark
runs-on: ${{ matrix.versions.os }}
strategy:
matrix:
Expand Down Expand Up @@ -39,10 +39,7 @@ jobs:
node-version: 16

- name: npm install
run: npm install

# - name: Lint
# run: npm run lint
run: npm ci

- name: Run setup-spark ${{ matrix.versions.spark }}
uses: ./
Expand All @@ -58,7 +55,7 @@ jobs:
test-setup-scala-version:
test-setup-spark-scala:
name: 🛢️ Test setup with specific Scala version
runs-on: ubuntu-latest
strategy:
Expand All @@ -81,7 +78,7 @@ jobs:
node-version: 16

- name: npm install
run: npm install
run: npm ci

- name: Run setup-spark ${{ matrix.versions.spark }}
uses: ./
Expand Down Expand Up @@ -117,13 +114,15 @@ jobs:


check-license:
name: 📜 Check licenses
name: 📜 Check licenses and eslint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm ci
- name: Install licensed
run: |
curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/3.1.0/licensed-3.1.0-linux-x64.tar.gz
tar -xzf licensed.tar.gz
- run: ./licensed status
- run: npm run test

# - name: Install licensed
# run: |
# curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/3.1.0/licensed-3.1.0-linux-x64.tar.gz
# tar -xzf licensed.tar.gz
# - run: ./licensed status
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ Format the code with prettier:
npm run fmt
```

Run licensed and eslint checks:

```bash
npm run test
```

## 📜 Check dependencies licenses

This repository uses a tool called [Licensed](https://github.com/github/licensed) to verify third party dependencies.
Expand Down
18 changes: 0 additions & 18 deletions __tests__/spark.tests.py

This file was deleted.

8 changes: 4 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const child_process_1 = __nccwpck_require__(81);
const fs = __importStar(__nccwpck_require__(147));
// See docs to create JS action: https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action
const log = (msg) => {
console.log(`${new Date().toLocaleTimeString('fr-FR')} - ${msg}`);
core.info(`${new Date().toLocaleTimeString('fr-FR')} - ${msg}`);
};
try {
const sparkVersion = core.getInput('spark-version');
Expand Down Expand Up @@ -83,7 +83,7 @@ try {
throw new Error(`The Spark binary was not properly downloaded from ${sparkUrl}`);
}
log(`Binary downloaded, setting up environment variables`);
const sparkHome = installFolder + '/spark';
const sparkHome = `${installFolder}/spark`;
const SPARK_OPTS = `--driver-java-options=-Xms1024M --driver-java-options=-Xmx2048M --driver-java-options=-Dlog4j.logLevel=info`;
const PYTHONPATH = `${sparkHome}/python:${sparkHome}/python/lib/py4j-${py4jVersion}-src.zip`;
const PYSPARK_PYTHON = 'python';
Expand All @@ -101,7 +101,7 @@ try {
}
catch (error) {
log(`Issue installing Spark: check if the Spark version and Hadoop versions you are using are part of the ones proposed on the Spark download page at https://spark.apache.org/downloads.html`);
console.log(error);
core.error(error);
core.setFailed(error.message);
}
// Helper function to download and unzip spark binary
Expand All @@ -116,7 +116,7 @@ function download(url, installFolder) {
(0, child_process_1.execSync)(untarCommand);
}
catch (error) {
log(`Error running the command to download the Spark binary`);
log(`Error running the command to download the Spark binary from ${url}`);
throw new Error(error.message);
}
}
Expand Down

0 comments on commit 5842e6b

Please sign in to comment.