diff --git a/.github/workflows/run-lint.yml b/.github/workflows/run-lint.yml new file mode 100644 index 000000000..3e033e24b --- /dev/null +++ b/.github/workflows/run-lint.yml @@ -0,0 +1,53 @@ +# This action runs unit tests for the OSCAL (schematron) validations to ensure validations +# are working against known samples +name: "OSCAL Validations: Style test" + +# Triggered when code is pushed to master and on pull requests +on: + push: + branches: + - master + - develop + - 'feature/**' # This will match any branch starting with "feature" + + pull_request: + +# the job requires some dependencies to be installed (including submodules), runs the tests, and then reports results +jobs: + # one job that runs tests + run-tests: + runs-on: ubuntu-20.04 + # Checkout repository and its submodules + steps: + # Check-out the repository under $GITHUB_WORKSPACE + - name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + + - name: Set up Java + uses: actions/setup-java@67fbd726daaf08212a7b021c1c4d117f94a81dd3 + with: + distribution: 'adopt' + java-version: '11' + - name: Read node version from `.nvmrc` file + id: nvmrc + shell: bash + run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV + + - name: Install required node.js version + uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b + with: + node-version: ${{ env.NODE_VERSION }} + - name: Install OSCAL CLI + run: | + make configure + - name: Run Lint tests + shell: bash + run: | + make lint + - name : Publish all Junit XML tests results in Github Summary + uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 + if: always() + with: + paths: | + **/reports/junit-*.xml + \ No newline at end of file diff --git a/features/steps/fedramp_extensions_steps.ts b/features/steps/fedramp_extensions_steps.ts index d1bd10876..424d1b1a6 100644 --- a/features/steps/fedramp_extensions_steps.ts +++ b/features/steps/fedramp_extensions_steps.ts @@ -697,7 +697,7 @@ Then('I should verify that all constraints follow the style guide constraint', a for (const file_name of constraint_files) { const filePath = join(constraintDir, file_name.trim()); try { - const {isValid,log} = await validateDocument(filePath,{flags:['disable-schema'],quiet,extensions:[styleGuidePath],module:"http://csrc.nist.gov/ns/oscal/metaschema/1.0"},'oscal-cli') + const {isValid,log} = await validateDocument(filePath,{flags:['disable-schema'],quiet,extensions:[styleGuidePath],module:"http://csrc.nist.gov/ns/oscal/metaschema/1.0"},executor) writeFileSync( join( __dirname,