Revert werkzeug dependency to >=2.3, <3.0 #335
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
name: AFIDs Validator CI Workflow | |
on: | |
pull_request_target: | |
types: [opened, reopened, synchronize, ready_for_review, closed] | |
jobs: | |
test: | |
name: Setup environment & test | |
if: github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10"] | |
steps: | |
- name: Setup python environment | |
uses: khanlab/actions/.github/actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
install-library: true | |
- name: Start PostgreSQL services | |
shell: bash | |
run: | | |
sudo systemctl start postgresql.service | |
pg_isready | |
- name: Setup PostgreSQL db | |
shell: bash | |
env: | |
psql_db_owner: testuser # PostgreSQL User | |
psql_db_pw: testpass # PostgreSQL Pass | |
psql_db_name: testdb # PostgreSQL DB | |
run: | | |
sudo -u postgres psql --command="CREATE USER $psql_db_owner PASSWORD '$psql_db_pw'" | |
sudo -u postgres createdb --owner=$psql_db_owner $psql_db_name | |
PGPASSWORD=$psql_db_pw psql --username=$psql_db_owner --host=localhost --list $psql_db_name | |
- name: Test AFIDs validator | |
shell: bash | |
env: | |
FLASK_ENV: testing # Sets flask environment | |
DATABASE_URL: postgresql://testuser:testpass@localhost/testdb | |
run: | | |
poetry run python -m unittest | |
linting: | |
name: Lint code | |
needs: [test] | |
if: github.event.pull_request.merged == false | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10"] | |
steps: | |
- name: Setup python environment | |
uses: khanlab/actions/.github/actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: isort | |
run: poetry run isort afidsvalidator test -c | |
- name: black | |
run: poetry run black afidsvalidator test --check | |
- name: flake8 | |
run: poetry run flake8 afidsvalidator test | |
- name: pylint | |
run: poetry run pylint afidsvalidator test | |
build-frontend: | |
needs: [linting] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache node installation | |
uses: actions/cache@v3 | |
with: | |
path: ~/.local | |
key: ${{ runner.os }}-node-${{ github.event.pull_request.id }} | |
- name: Install node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Install react dependencies | |
run: | | |
npm --prefix afidsvalidator/static/lib/afidsvalidator-react install | |
- name: Build react frontend | |
run: | | |
npm run --prefix afidsvalidator/static/lib/afidsvalidator-react build | |
- name: Check changes | |
run: | | |
gh_status=$(git status --porcelain) | |
if [ -z "$gh_status" ]; then | |
echo 'modified="false"' >> $GITHUB_ENV | |
else | |
echo 'modified="true"' >> $GITHUB_ENV | |
fi | |
- name: Commit changes | |
if: env.modified == 'true' | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git diff-index --quiet HEAD || git commit -m "[BOT] Build react frontend" -a | |
- name: Push to repo | |
if: env.modified == 'true' | |
uses: CasperWA/push-protected@v2 | |
with: | |
branch: ${{ github.event.pull_request.head.ref }} | |
token: ${{ secrets.BP_PAT_TOKEN }} | |
unprotect_reviews: true | |
assign-reviewer: | |
needs: [build-frontend] | |
if: github.event.pull_request.assignee == null | |
uses: khanlab/actions/.github/workflows/[email protected] | |
update_changelog: | |
if: github.event.pull_request.merged == true | |
uses: khanlab/actions/.github/workflows/[email protected] | |
secrets: | |
BP-PAT: ${{ secrets.BP_PAT_TOKEN }} |