chore: remove excluded ruff rules and fix issues #5
Workflow file for this run
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 workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: "Build, lint, and test" | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- uses: bufbuild/buf-setup-action@v1.27.1 | |
with: | |
github_token: ${{ github.token }} | |
- name: Upgrade pip | |
run: pip install --upgrade pip | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: python | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Run pre-commit | |
uses: pre-commit/action@v3.0.0 | |
- name: Generate flagd protobuf files | |
run: | | |
cd schemas | |
buf generate buf.build/open-feature/flagd --template protobuf/buf.gen.python.yaml | |
cd ../ | |
rm -rf openfeature/contrib/providers/flagd/proto | |
mv proto/python openfeature/contrib/providers/flagd/proto | |
sed -i.bak 's/^from schema.v1 import/from . import/' openfeature/contrib/providers/flagd/proto/schema/v1/*.py | |
rm openfeature/contrib/providers/flagd/proto/schema/v1/*.bak | |
rmdir proto | |
- name: Test with pytest | |
run: coverage run --omit="*/test*" -m pytest | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@e0fbd592d323cb2991fb586fdd260734fcb41fcb | |
with: | |
flags: unittests # optional | |
name: coverage # optional | |
fail_ci_if_error: true # optional (default = false) | |
verbose: true # optional (default = false) | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v2 |