Merge pull request #10 from valory-xyz/feature/service-deploy #73
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: main_workflow | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
lock_check: | |
continue-on-error: False | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
python-version: ["3.10.9"] | |
timeout-minutes: 18 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@master | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Poetry lock | |
run: | | |
pip install poetry | |
poetry lock | |
poetry install | |
copyright: | |
continue-on-error: False | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.10.9"] | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@master | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
sudo apt-get update --fix-missing | |
sudo apt-get autoremove | |
sudo apt-get autoclean | |
pip install tomte[tox]==0.2.4 | |
pip install --user --upgrade setuptools | |
- name: Check copyright headers | |
run: tox -e check-copyright | |
- name: License compatibility check | |
run: tox -e liccheck | |
linter_checks: | |
continue-on-error: False | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.10.9"] | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@master | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
sudo apt-get update --fix-missing | |
sudo apt-get autoremove | |
sudo apt-get autoclean | |
pip install tomte[tox]==0.2.4 | |
pip install --user --upgrade setuptools | |
- name: Security checks | |
run: | | |
tox -e bandit | |
tox -e safety | |
- name: Code style check | |
run: | | |
tox -e black-check | |
tox -e isort-check | |
tox -e flake8 | |
tox -e vulture | |
tox -e darglint | |
- name: Static type check | |
run: tox -e mypy | |
- name: Pylint | |
run: tox -e pylint | |
scan: | |
name: gitleaks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: "1.17.7" | |
- run: | | |
wget https://github.com/zricethezav/gitleaks/releases/download/v8.10.1/gitleaks_8.10.1_linux_x64.tar.gz && \ | |
tar -xzf gitleaks_8.10.1_linux_x64.tar.gz && \ | |
sudo install gitleaks /usr/bin && \ | |
gitleaks detect --report-format json --report-path leak_report -v | |
test: | |
continue-on-error: True | |
needs: | |
- lock_check | |
- copyright | |
- linter_checks | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
python-version: ["3.10.9", "3.11"] | |
timeout-minutes: 90 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- uses: actions/setup-python@master | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: "1.17.7" | |
- if: matrix.os == 'ubuntu-latest' | |
name: Install dependencies (ubuntu-latest) | |
run: | | |
sudo apt-get update --fix-missing | |
sudo apt-get autoremove | |
sudo apt-get autoclean | |
pip install tomte[tox]==0.2.4 | |
pip install --user --upgrade setuptools | |
- if: matrix.os == 'ubuntu-latest' | |
name: Unit tests on ubuntu-latest | |
run: | | |
tox -e py${{ matrix.python-version }}-linux | |
- if: matrix.os == 'macos-latest' | |
name: Install dependencies (macos-latest) | |
run: | | |
pip install tomte[tox]==0.2.4 | |
brew install gcc | |
# brew install protobuf | |
# brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/72457f0166d5619a83f508f2345b22d0617b5021/Formula/protobuf.rb | |
- if: matrix.os == 'macos-latest' | |
name: Unit tests on macos-latest | |
run: | | |
tox -e py${{ matrix.python-version }}-darwin | |
- if: matrix.os == 'windows-latest' | |
name: Install dependencies (windows-latest) | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
run: | | |
python -m pip install -U pip | |
echo "::add-path::C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64" | |
choco install wget -y | |
choco install mingw -y | |
choco install make -y | |
# to check make was installed | |
make --version | |
pip install tomte[tox]==0.2.4 | |
- if: matrix.os == 'windows-latest' | |
name: Unit tests on windows-latest | |
run: | | |
tox -e py${{ matrix.python-version }}-win |