test #11
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: Code quality | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
# format: | |
# name: Format | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Check out repository | |
# uses: actions/checkout@v4 | |
# - name: Set up environment | |
# uses: ./.github/actions/setup/poetry | |
# with: | |
# os: ${{ job.os }} | |
# python-version: '3.13.0' | |
# poetry-install-options: "--only=code_quality --no-root" | |
# poetry-export-options: "--only=code_quality" | |
# - name: Check code style | |
# run: poetry run ruff format --check | |
# - name: Checkout code | |
# uses: actions/checkout@v4 | |
# # - name: Create output directory | |
# # run: | | |
# # mkdir -p "$(dirname "hadolint-results-${{ matrix.dockerfile }}.sarif")" | |
# - name: Run Hadolint | |
# uses: hadolint/[email protected] | |
# with: | |
# dockerfile: ${{ matrix.dockerfile }} | |
# format: sarif | |
# output-file: hadolint-results-${{ matrix.dockerfile }}.sarif | |
# no-fail: true | |
# ignore: DL3008,DL3013 | |
# - name: Upload hadolint results to github security tab | |
# uses: github/codeql-action/upload-sarif@v3 | |
# if: always() | |
# with: | |
# sarif_file: hadolint-results-${{ matrix.dockerfile }}.sarif | |
# wait-for-processing: true | |
hadolint: | |
name: Dockerfile Lint | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
strategy: | |
matrix: | |
dockerfile: | |
- jupyterhub/hub/hub.Dockerfile | |
- jupyterhub/notebook/notebook.Dockerfile | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Sanitize Dockerfile name | |
id: sanitize_name | |
run: | | |
IMAGE_NAME="$(basename '${{ matrix.dockerfile }}' | sed 's/.Dockerfile//'):${{github.sha}}" | |
echo "safe_name=$IMAGE_NAME" >> $GITHUB_OUTPUT | |
- name: Run Hadolint | |
uses: hadolint/[email protected] | |
with: | |
dockerfile: ${{ matrix.dockerfile }} | |
format: sarif | |
output-file: hadolint-results-${{ steps.sanitize_name.outputs.safe_name }}.sarif | |
no-fail: true | |
ignore: DL3008,DL3013 | |
- name: Upload hadolint results to GitHub Security tab | |
uses: github/codeql-action/upload-sarif@v3 | |
if: always() | |
with: | |
sarif_file: hadolint-results-${{ steps.sanitize_name.outputs.safe_name }}.sarif | |
wait-for-processing: true | |
# lint: | |
# name: Lint | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Check out repository | |
# uses: actions/checkout@v4 | |
# - name: Set up environment | |
# uses: ./.github/actions/setup/poetry | |
# with: | |
# os: ${{ job.os }} | |
# python-version: '3.13.0' | |
# poetry-install-options: "--only=code_quality --no-root" | |
# poetry-export-options: "--only=code_quality" | |
# - name: Check code quality | |
# run: poetry run ruff check . | |
# spell-check: | |
# name: Spell check | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Check out repository | |
# uses: actions/checkout@v4 | |
# - name: Set up environment | |
# uses: ./.github/actions/setup/poetry | |
# with: | |
# os: ${{ job.os }} | |
# python-version: '3.13.0' | |
# poetry-install-options: "--only=code_quality --no-root" | |
# poetry-export-options: "--only=code_quality" | |
# - name: Check spellings | |
# run: poetry run typos . | |
# type-check: | |
# name: Type check | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Check out repository | |
# uses: actions/checkout@v4 | |
# - name: Set up environment | |
# uses: ./.github/actions/setup/poetry | |
# with: | |
# os: ${{ job.os }} | |
# python-version: '3.13.0' | |
# poetry-install-options: "--with=code_quality --with=types --no-root" | |
# poetry-export-options: "--with=code_quality --with=types" | |
# - name: Check types | |
# run: poetry run mypy jupyterhub/ | |
... |