-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #714 from italia/feature/improvements
Feature/improvements
- Loading branch information
Showing
24 changed files
with
106 additions
and
1,419 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,9 +20,17 @@ jobs: | |
node-version: '16' | ||
check-latest: true | ||
cache: yarn | ||
- name: Test rules | ||
- uses: robinraju/[email protected] | ||
with: | ||
repository: italia/api-oas-checker-rules | ||
fileName: '*' | ||
out-file-path: rulesets/ | ||
latest: true | ||
- name: Unzip files | ||
run: | | ||
make test | ||
for file in rulesets/*.zip; do | ||
unzip -o "$file" -d rulesets/ | ||
done | ||
- name: Build ui, test ui and deploy | ||
run: | | ||
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/italia/api-oas-checker.git | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
bundle | ||
node_modules | ||
rules | ||
security | ||
*.md | ||
*.yml | ||
*.yaml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,13 @@ | ||
# | ||
# Tasks set to build ruleset, bundle js, test and deploy | ||
# | ||
# | ||
|
||
RULE_FILES := spectral.yml spectral-full.yml spectral-security.yml spectral-generic.yml spectral-modi.yml | ||
RULE_DOCS := $(RULE_FILES:.yml=.doc.html) | ||
|
||
all: clean install rules build test-ui | ||
|
||
# Clean artifacts from the previous build | ||
clean: | ||
rm -f $(RULE_DOCS) | ||
rm -f $(RULE_FILES) | ||
rm -rf functions | ||
all: install build | ||
|
||
# Install node dependencies | ||
install: yarn.lock | ||
rm -rf node_modules | ||
yarn install --frozen-lockfile | ||
|
||
# Generate spectral ruleset with documentation | ||
rules: clean $(RULE_FILES) | ||
|
||
rulesets-dir: | ||
@mkdir -p functions | ||
@mkdir -p rules-modi/rulesets | ||
@mkdir -p rules-modi/rulesets/functions | ||
|
||
spectral.yml: ./rules-modi/rules/ rulesets-dir | ||
make -C rules-modi $@ && mv rules-modi/rulesets/$@ . | ||
node ruleset_doc_generator.mjs --file $@ --title 'Italian Guidelines Extended' | ||
spectral-generic.yml: ./rules-modi/rules/ spectral.yml rulesets-dir | ||
make -C rules-modi $@ && mv rules-modi/rulesets/$@ . | ||
node ruleset_doc_generator.mjs --file $@ --title 'Best Practices Only' | ||
spectral-security.yml: ./rules-modi/rules/ ./rules-modi/security/ rulesets-dir | ||
make -C rules-modi $@ && mv rules-modi/rulesets/$@ . && mv rules-modi/rulesets/functions/* functions/ | ||
node ruleset_doc_generator.mjs --file $@ --title 'Extra Security Checks' | ||
spectral-full.yml: spectral.yml spectral-security.yml rulesets-dir | ||
make -C rules-modi $@ && mv rules-modi/rulesets/$@ . | ||
node ruleset_doc_generator.mjs --file $@ --title 'Italian Guidelines Extended + Extra Security Checks' | ||
spectral-modi.yml: rulesets-dir | ||
make -C rules-modi $@ && mv rules-modi/rulesets/$@ . | ||
node ruleset_doc_generator.mjs --file $@ --title 'Italian Guidelines' | ||
|
||
# Build js bundle | ||
build: install rules | ||
build: install | ||
yarn build-js | ||
|
||
# Run test suite | ||
test-ui: install | ||
yarn eslint | ||
yarn test | ||
|
||
# TODO: this doesn't work on MacOS! | ||
test: install | ||
bash test-ruleset.sh rules-modi/rules/ all | ||
bash test-ruleset.sh rules-modi/security/ all | ||
|
||
# regression test with existing files | ||
ittest: test rules | ||
(cd ittest && bash ittest.sh) | ||
|
||
deploy: all | ||
yarn deploy | ||
yarn deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.