Skip to content

Commit

Permalink
Update CI to use the correct paths
Browse files Browse the repository at this point in the history
  • Loading branch information
wargio committed Aug 17, 2023
1 parent e41c21a commit 2704024
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .ci-scripts/ci-eslint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -e
npm install -s eslint

## NPM test
find ./libdec -type f -name "*.js" | xargs node_modules/.bin/eslint -c ./.eslintrc.json
find ./js -type f -name "*.js" | xargs node_modules/.bin/eslint -c ./.eslintrc.json
27 changes: 10 additions & 17 deletions .ci-scripts/ci-tests.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
#!/bin/bash
set -e

CI_BRANCH="$1"
sudo apt update > /dev/null
sudo apt -y install meson ninja-build

echo "Branch: $CI_BRANCH"
make --no-print-directory testbin -C p
ERRORED=$?
if [ "$ERRORED" == "1" ]; then
exit $ERRORED
fi
CI_BRANCH="$1"
CI_JSDEC="$PWD"

## jsdec-test
cd ..
CI_WORKDIR=$(pwd)
echo "Work dir: $CI_WORKDIR"
echo "CI_BRANCH: $CI_BRANCH"
echo "CI_JSDEC: $CI_JSDEC"

rm -rf jsdec-test >/dev/null 2>&1 || echo "no need to clean.."
git clone --branch "$CI_BRANCH" --depth 1 https://github.com/rizinorg/jsdec-test || git clone --depth 1 https://github.com/rizinorg/jsdec-test
cd jsdec-test
rm -rf tests >/dev/null 2>&1 || echo "no need to clean.."
git clone --branch "$CI_BRANCH" --depth 1 https://github.com/rizinorg/jsdec-test tests || git clone --depth 1 https://github.com/rizinorg/jsdec-test tests
cd tests
chmod +x testall.sh
./testall.sh "$CI_WORKDIR/jsdec" travis
ERRORED=$?
cd ..
./testall.sh "$CI_JSDEC" travis
15 changes: 7 additions & 8 deletions .github/workflows/continuous-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,22 @@ jobs:
with:
node-version: '16'
- name: eslint
run: chmod +x .ci-scripts/ci-eslint.sh && .ci-scripts/ci-eslint.sh ${GITHUB_REF##*/}
run: chmod +x .ci-scripts/ci-eslint.sh && .ci-scripts/ci-eslint.sh

tests:
name: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout jsdec-test
uses: actions/checkout@v3
- name: tests
run: chmod +x .ci-scripts/ci-tests.sh && .ci-scripts/ci-tests.sh ${GITHUB_REF##*/}
run: chmod +x .ci-scripts/ci-tests.sh && .ci-scripts/ci-tests.sh "${{ github.ref_name }}"

licenses:
name: licenses
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: REUSE Compliance Check
uses: fsfe/[email protected]
- name: Reuse Compliance Check
uses: fsfe/reuse-action@v2
with:
args: --suppress-deprecation lint
13 changes: 0 additions & 13 deletions js/libdec/JSONex.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@ var json_parse = function(options) {
// a JSON parser in other languages.
// We are defining the function inside of another function to avoid creating
// global variables.
// Default options one can override by passing options to the parse()
var _options = {
"strict": false, // not being strict means do not generate syntax errors for "duplicate key"
};
// If there are options, then use them to override the default _options
if (options !== undefined && options !== null) {
if (options.strict === true) {
_options.strict = true;
}
}
var at, // The index of the current character
ch, // The current character
escapee = {
Expand Down Expand Up @@ -207,9 +197,6 @@ var json_parse = function(options) {
key = string();
white();
next(':');
if (_options.strict === true && Object.hasOwnProperty.call(object, key)) {
error('Duplicate key "' + key + '"');
}
object[key] = value();
white();
if (ch === '}') {
Expand Down

0 comments on commit 2704024

Please sign in to comment.