Adding initial code #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: ci-workflow | |
on: [push] | |
jobs: | |
ci-job: | |
runs-on: ubuntu-latest | |
steps: | |
- name: clone the repository | |
uses: actions/checkout@v3 | |
- name: install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: install Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.3' | |
- name: install cfn_nag | |
run: | | |
gem install cfn-nag | |
- name: cfn_nag | |
run: | | |
cfn_nag_scan --input-path template.yaml | |
- name: install cfn-lint | |
run: | | |
pip install cfn-lint | |
- name: cfn-lint | |
run: | | |
cfn-lint template.yaml | |
- name: install bandit | |
run: | | |
pip install bandit | |
- name: bandit checks | |
run: | | |
bandit -r sam_sp_ri_utility/app.py --confidence-level high | |
bandit -r sam_sp_ri_utility/services/*.py --confidence-level high | |
bandit -r sam_sp_ri_utility/test/utilities.py --confidence-level high | |
- name: install homebrew and git-secrets | |
run: | | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" | |
test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv) | |
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) | |
echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile | |
brew --version | |
brew upgrade | |
brew install git-secrets | |
sudo cp /home/linuxbrew/.linuxbrew/bin/git-secrets /usr/bin/ | |
- name: git-secrets | |
run: | | |
git secrets --scan | |
- name: install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: unit tests | |
run: | | |
pytest |