forked from OWASP/Nest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
721 additions
and
7 deletions.
There are no files selected for viewing
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 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 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
2 changes: 1 addition & 1 deletion
2
.github/workflows/sync.yaml → .github/workflows/sync-nest-data.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Sync data | ||
name: Sync Nest data | ||
|
||
on: | ||
schedule: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
name: Test OWASP Schema | ||
|
||
on: | ||
merge_group: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- schema/** | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- schema/** | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
cancel-in-progress: true | ||
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }} | ||
|
||
env: | ||
DOCKERHUB_USERNAME: arkid15r | ||
FORCE_COLOR: 1 | ||
|
||
jobs: | ||
pre-commit: | ||
name: Run pre-commit | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Poetry | ||
run: pipx install poetry | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
cache: poetry | ||
cache-dependency-path: schema/poetry.lock | ||
python-version: '3.13' | ||
|
||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] | ||
|
||
- name: Check for uncommitted changes | ||
run: | | ||
git diff --exit-code || (echo 'Unstaged changes detected. \ | ||
Run `make check` and use `git add` to address it.' && exit 1) | ||
code-ql: | ||
name: CodeQL | ||
permissions: | ||
security-events: write | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
language: | ||
- python | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Perform CodeQL analysis | ||
uses: github/codeql-action/analyze@v3 | ||
with: | ||
category: '/language:${{ matrix.language }}' | ||
|
||
spellcheck: | ||
name: Run spell check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run cspell | ||
run: | | ||
make spellcheck | ||
run-schema-tests: | ||
name: Run schema tests | ||
needs: | ||
- pre-commit | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build schema test image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
cache-from: type=registry,ref=${{ env.DOCKERHUB_USERNAME }}/owasp-nest-test-schema:cache | ||
context: schema | ||
file: schema/Dockerfile.test | ||
load: true | ||
platforms: linux/amd64 | ||
tags: ${{ env.DOCKERHUB_USERNAME }}/owasp-nest-test-schema:latest | ||
|
||
- name: Run schema tests | ||
run: | | ||
docker run ${{ env.DOCKERHUB_USERNAME }}/owasp-nest-test-schema:latest poetry run pytest |
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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM python:3.13-slim | ||
|
||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
||
RUN groupadd owasp && \ | ||
useradd --create-home --home-dir /home/owasp -g owasp owasp && \ | ||
apt-get update && apt-get upgrade -y && \ | ||
apt-get install -y gcc libpq-dev && \ | ||
apt-get clean -y && rm -rf /var/lib/apt/lists/* && \ | ||
python -m pip install --no-cache-dir poetry | ||
|
||
ENV FORCE_COLOR=1 | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
WORKDIR /home/owasp | ||
|
||
USER owasp | ||
|
||
COPY poetry.lock pyproject.toml ./ | ||
RUN poetry install --no-root | ||
|
||
COPY project.json project.json | ||
COPY tests tests |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
test-schema: | ||
@docker build -f schema/Dockerfile.test schema -t nest-test-schema | ||
@docker run nest-test-schema poetry run pytest |
Oops, something went wrong.