diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6526891 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,73 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + lints: + name: Run linters + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + + - name: Cache pre-commit + uses: actions/cache@v3 + with: + path: ~/.cache/pre-commit + key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} + + - name: Install pre-commit + run: pip3 install pre-commit + + - name: Run pre-commit checks + run: pre-commit run --all-files --show-diff-on-failure --color always + + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@0.12.0 + with: + scan-type: "fs" + ignore-unfixed: true + format: "table" + severity: "CRITICAL,HIGH" + + - name: Create venv + run: . ./setup_dev_env.sh + + - name: Check licenses + run: ./check_licenses.sh + + tests: + name: Run tests + runs-on: ubuntu-latest + container: python:3.11 + + steps: + - uses: actions/checkout@v2 + + - name: Cache Dependencies + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Install Dependencies + run: pip install -r requirements-dev.txt + + - name: Run Tests + run: pytest -v -p no:warnings --junitxml=report.xml tests/ + + - name: Publish Test Report + uses: actions/upload-artifact@v2 + with: + name: Test Report + path: report.xml + retention-days: 10 diff --git a/.github/workflows/doumentation.yml b/.github/workflows/doumentation.yml new file mode 100644 index 0000000..48ac152 --- /dev/null +++ b/.github/workflows/doumentation.yml @@ -0,0 +1,33 @@ +name: CI + +on: + push: + branches: [main] + +jobs: + pages: + runs-on: ubuntu-latest + container: python:3.11 + + steps: + - uses: actions/checkout@v2 + + - name: Cache Dependencies + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Install Dependencies + run: pip install -r requirements.txt + + - name: Build docs + run: ./build_docs.sh + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./public \ No newline at end of file