Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: meet Workflow
name: build and test

on:
push:
Expand All @@ -11,63 +11,6 @@
contents: read

jobs:
lint-git:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' # Makes sense only for pull requests
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: show
run: git log
- name: Enforce absence of print statements in code
if: always()
run: |
! git diff origin/${{ github.event.pull_request.base.ref }}..HEAD -- . ':(exclude)**/meet.yml' | grep "print("
- name: Check absence of fixup commits
if: always()
run: |
! git log | grep 'fixup!'
- name: Install gitlint
if: always()
run: pip install --user requests gitlint
- name: Lint commit messages added to main
if: always()
run: ~/.local/bin/gitlint --commits origin/${{ github.event.pull_request.base.ref }}..HEAD

check-changelog:
runs-on: ubuntu-latest
if: |
contains(github.event.pull_request.labels.*.name, 'noChangeLog') == false &&
github.event_name == 'pull_request'
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 50
- name: Check that the CHANGELOG has been modified in the current branch
run: git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.after }} | grep 'CHANGELOG.md'

lint-changelog:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Check CHANGELOG max line length
run: |
max_line_length=$(cat CHANGELOG.md | grep -Ev "^\[.*\]: https://github.com" | wc -L)
if [ $max_line_length -ge 80 ]; then
echo "ERROR: CHANGELOG has lines longer than 80 characters."
exit 1
fi

build-mails:
runs-on: ubuntu-latest
permissions:
Expand All @@ -93,11 +36,11 @@

- name: Install yarn
if: steps.mail-templates.outputs.cache-hit != 'true'
run: npm install -g yarn

Check warning on line 39 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--ignore-scripts" allows lifecycle scripts to run during package installation.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJW&open=AaABAC0VkdcfuurrCTJW&pullRequest=1594

Check warning on line 39 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJX&open=AaABAC0VkdcfuurrCTJX&pullRequest=1594

- name: Install node dependencies
if: steps.mail-templates.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile

Check warning on line 43 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Lifecycle scripts are enabled by default in Yarn v2+.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJY&open=AaABAC0VkdcfuurrCTJY&pullRequest=1594

- name: Build mails
if: steps.mail-templates.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -125,16 +68,16 @@
with:
python-version: "3.13"
- name: Install uv
uses: astral-sh/setup-uv@v7

Check failure on line 71 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use full commit SHA hash for this dependency.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJZ&open=AaABAC0VkdcfuurrCTJZ&pullRequest=1594
- name: Install the project
run: uv sync --locked --all-extras

Check warning on line 73 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--no-build" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJa&open=AaABAC0VkdcfuurrCTJa&pullRequest=1594

- name: Check code formatting with ruff
run: uv run ruff format . --diff

Check warning on line 76 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJc&open=AaABAC0VkdcfuurrCTJc&pullRequest=1594

Check warning on line 76 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--no-build" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJb&open=AaABAC0VkdcfuurrCTJb&pullRequest=1594
- name: Lint code with ruff
run: uv run ruff check .

Check warning on line 78 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJe&open=AaABAC0VkdcfuurrCTJe&pullRequest=1594

Check warning on line 78 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--no-build" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJd&open=AaABAC0VkdcfuurrCTJd&pullRequest=1594
- name: Lint code with pylint
run: uv run pylint meet demo core

Check warning on line 80 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--no-build" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJf&open=AaABAC0VkdcfuurrCTJf&pullRequest=1594

Check warning on line 80 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJg&open=AaABAC0VkdcfuurrCTJg&pullRequest=1594

lint-agents:
runs-on: ubuntu-latest
Expand All @@ -151,13 +94,13 @@
with:
python-version: "3.13"
- name: Install uv
uses: astral-sh/setup-uv@v7

Check failure on line 97 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use full commit SHA hash for this dependency.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJh&open=AaABAC0VkdcfuurrCTJh&pullRequest=1594
- name: Install the project
run: uv sync --locked --all-extras

Check warning on line 99 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--no-build" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJi&open=AaABAC0VkdcfuurrCTJi&pullRequest=1594
- name: Check code formatting with ruff
run: uv run ruff format . --diff

Check warning on line 101 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJk&open=AaABAC0VkdcfuurrCTJk&pullRequest=1594

Check warning on line 101 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--no-build" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJj&open=AaABAC0VkdcfuurrCTJj&pullRequest=1594
- name: Lint code with ruff
run: uv run ruff check .

Check warning on line 103 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--no-build" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJl&open=AaABAC0VkdcfuurrCTJl&pullRequest=1594

Check warning on line 103 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJm&open=AaABAC0VkdcfuurrCTJm&pullRequest=1594

lint-summary:
runs-on: ubuntu-latest
Expand All @@ -175,7 +118,7 @@
python-version: "3.13"
cache: "pip"
- name: Install development dependencies
run: pip install --user .[dev]

Check warning on line 121 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--only-binary :all:" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJn&open=AaABAC0VkdcfuurrCTJn&pullRequest=1594

Check warning on line 121 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJo&open=AaABAC0VkdcfuurrCTJo&pullRequest=1594
- name: Check code formatting with ruff
run: ~/.local/bin/ruff format . --diff
- name: Lint code with ruff
Expand Down Expand Up @@ -262,7 +205,7 @@
# Tool to wait for a service to be ready
- name: Install Dockerize
run: |
curl -sSL https://github.com/jwilder/dockerize/releases/download/v0.8.0/dockerize-linux-amd64-v0.8.0.tar.gz | sudo tar -C /usr/local/bin -xzv

Check warning on line 208 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Not enforcing HTTPS here might allow for redirections to insecure websites. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJp&open=AaABAC0VkdcfuurrCTJp&pullRequest=1594

- name: Wait for MinIO to be ready
run: |
Expand All @@ -281,9 +224,9 @@
with:
python-version: "3.13"
- name: Install uv
uses: astral-sh/setup-uv@v7

Check failure on line 227 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use full commit SHA hash for this dependency.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJq&open=AaABAC0VkdcfuurrCTJq&pullRequest=1594
- name: Install the dependencies
run: uv sync --locked --all-extras

Check warning on line 229 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--no-build" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJr&open=AaABAC0VkdcfuurrCTJr&pullRequest=1594

- name: Install gettext (required to compile messages)
run: |
Expand All @@ -291,10 +234,10 @@
sudo apt-get install -y gettext

- name: Generate a MO file from strings extracted from the project
run: uv run python manage.py compilemessages

Check warning on line 237 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--no-build" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJs&open=AaABAC0VkdcfuurrCTJs&pullRequest=1594

Check warning on line 237 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJt&open=AaABAC0VkdcfuurrCTJt&pullRequest=1594

- name: Run tests
run: uv run pytest -n 2

Check warning on line 240 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJv&open=AaABAC0VkdcfuurrCTJv&pullRequest=1594

Check warning on line 240 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--no-build" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJu&open=AaABAC0VkdcfuurrCTJu&pullRequest=1594

test-summary:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -334,7 +277,7 @@
cache: "pip"

- name: Install development dependencies
run: pip install --user .[dev]

Check warning on line 280 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJx&open=AaABAC0VkdcfuurrCTJx&pullRequest=1594

Check warning on line 280 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--only-binary :all:" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJw&open=AaABAC0VkdcfuurrCTJw&pullRequest=1594

- name: Run summary tests
run: ~/.local/bin/pytest
Expand All @@ -348,14 +291,11 @@
uses: actions/checkout@v6

- name: Install dependencies
run: cd src/frontend/ && npm ci

Check warning on line 294 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--ignore-scripts" allows lifecycle scripts to run during package installation.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJy&open=AaABAC0VkdcfuurrCTJy&pullRequest=1594

- name: Check linting
run: cd src/frontend/ && npm run lint

- name: Check format
run: cd src/frontend/ && npm run check

lint-sdk:
runs-on: ubuntu-latest
permissions:
Expand All @@ -368,7 +308,7 @@
uses: actions/checkout@v6

- name: Install dependencies
run: npm ci

Check warning on line 311 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--ignore-scripts" allows lifecycle scripts to run during package installation.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJz&open=AaABAC0VkdcfuurrCTJz&pullRequest=1594

- name: Check linting
run: npm run lint
Expand All @@ -389,7 +329,7 @@
uses: actions/checkout@v6

- name: Install dependencies
run: npm ci

Check warning on line 332 in .github/workflows/build-and-test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--ignore-scripts" allows lifecycle scripts to run during package installation.

See more on https://sonarcloud.io/project/issues?id=suitenumerique_meet&issues=AaABAC0VkdcfuurrCTJ0&open=AaABAC0VkdcfuurrCTJ0&pullRequest=1594

- name: Build SDK
run: npm run build
139 changes: 139 additions & 0 deletions .github/workflows/static-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: static checks

# The checks that read a branch rather than execute it. They live here, and not
# in build-and-test.yml, so they report on a pull request from a first-time
# contributor, whose pull_request run waits for a maintainer to approve it. On
# a push to main, the two that read a commit rather than a pull request run
# over what was pushed.
#
# pull_request_target runs with this repository's token, so nothing the branch
# controls may be installed, imported or executed here. Do not add a step that
# builds or tests it: that needs pull_request, and the wait that comes with it.
# https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/

on:
push:
branches:
- main
pull_request_target:
types:
- opened
- reopened
- synchronize
- labeled
- unlabeled

# every job below grants itself what it needs, so a job added without a block
# gets nothing rather than the repository default
permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
HEAD_REF: refs/pull/${{ github.event.pull_request.number }}/head

jobs:
check-format:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
# persist-credentials keeps this repository's token out of .git/config,
# which the branch's own files land beside
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-node@v6
with:
node-version: "22"
cache: npm
cache-dependency-path: src/frontend/package-lock.json
- name: Install dependencies
run: cd src/frontend/ && npm ci --ignore-scripts
- name: Read the branch's sources as data
if: github.event_name == 'pull_request_target'
run: |
git fetch --no-tags --depth 1 origin "$HEAD_REF"
rm -rf src/frontend/src
git checkout FETCH_HEAD -- src/frontend/src
# without --config prettier loads one the branch left among its own files,
# and without --no-editorconfig an .editorconfig left there moves printWidth
# and tabWidth, which .prettierrc does not set and so cannot override
- name: Check format
run: cd src/frontend/ && npm run check -- --config .prettierrc --no-editorconfig

lint-changelog:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Read the branch's changelog as data
env:
GH_TOKEN: ${{ github.token }}
REF: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
gh api -H 'Accept: application/vnd.github.raw' \
"repos/${{ github.repository }}/contents/CHANGELOG.md?ref=$REF" \
> CHANGELOG.md
- name: Check CHANGELOG max line length
run: |
max_line_length=$(cat CHANGELOG.md | grep -Ev "^\[.*\]: https://github.com" | wc -L)
if [ $max_line_length -ge 80 ]; then
echo "ERROR: CHANGELOG has lines longer than 80 characters."
exit 1
fi

check-changelog:
if: |
github.event_name == 'pull_request_target' &&
contains(github.event.pull_request.labels.*.name, 'noChangelog') == false
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
# unanchored, so a path ending in CHANGELOG.md anywhere counts
- name: Check that the CHANGELOG has been modified in the current branch
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api --paginate \
"repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" \
--jq '.[].filename' | grep 'CHANGELOG.md'

lint-git:
if: github.event_name == 'pull_request_target'
runs-on: ubuntu-latest
permissions:
contents: read
env:
BASE_REF: ${{ github.event.pull_request.base.ref }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
filter: blob:none
persist-credentials: false
- name: Read the branch's commits as data
run: git fetch --no-tags origin "$HEAD_REF"
# added lines only, since deleting a print is not a violation, and the
# pattern is spelled so that this line does not match itself
- name: Enforce absence of print statements in code
if: always()
run: |
! git diff "origin/$BASE_REF...FETCH_HEAD" | grep '^+.*print[(]'
- name: Check absence of fixup commits
if: always()
run: |
! git log "origin/$BASE_REF..FETCH_HEAD" | grep 'fixup!'
- name: Install gitlint
if: always()
run: "pip install --user --only-binary=:all: requests==2.34.2 gitlint==0.18.0"
# gitlint imports gitlint/, so those rules must come from this checkout
- name: Lint commit messages added to main
if: always()
run: ~/.local/bin/gitlint --commits "origin/$BASE_REF..FETCH_HEAD"