Check project standards #1
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
name: Check project standards | |
on: [workflow_call, workflow_dispatch] | |
jobs: | |
check-python: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: pip | |
- run: test -f requirements.txt && pip install -r requirements.txt && python -m flake8 && python -m black | |
check-cloudformation: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: pip | |
- name: cfn-lint | |
run: | | |
test -f requirements.txt \ | |
&& grep --quiet "cfn-lint" requirements.txt \ | |
&& pip install -r requirements.txt \ | |
&& find . -name "*.yml" -type f ! -path "*/node_modules/*" ! -path "./vendor/bundle/*" ! -path "./.github/*" -mindepth 2 -print0 | xargs -0 -n1 cfn-lint --ignore-checks E3008 --template | |
check-ruby: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- run: test -f Gemfile && bundle exec standardrb | |
check-javascript: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: yarn | |
- run: | | |
test -f yarn.lock \ | |
&& yarn install \ | |
&& npm exec prettier -- --check "**/*.{json,yml}" \ | |
&& npm exec eslint -- "**/*.js" \ | |
&& npm exec tsc |