Skip to content

Commit

Permalink
fix: yml formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgrittner committed Aug 19, 2024
1 parent 62f0c63 commit 94afdbb
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 117 deletions.
56 changes: 28 additions & 28 deletions .github/workflows/publish-docker-images.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
name: Publish Docker Images
on:
workflow_call:
inputs:
os:
description: OS
required: false
default: ubuntu-latest
git-ref:
description: Git branch or ref
required: false
default: ""
workflow_call:
inputs:
os:
description: OS
required: false
default: ubuntu-latest
git-ref:
description: Git branch or ref
required: false
default: ""
jobs:
publish-to-docker-hub:
name: Publish Docker Images
runs-on: ${{ inputs.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
repository: ${{ github.repository }}
ref: ${{ github.event.pull_request.head.sha }}
- name: Login to docker hub
uses: actions-hub/docker/login@master
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Use Docker CLI
uses: actions-hub/docker/cli@master
- name: Build and push Docker images
run: cd docker && ./release_images.sh
publish-to-docker-hub:
name: Publish Docker Images
runs-on: ${{ inputs.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
repository: ${{ github.repository }}
ref: ${{ github.event.pull_request.head.sha }}
- name: Login to docker hub
uses: actions-hub/docker/login@master
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Use Docker CLI
uses: actions-hub/docker/cli@master
- name: Build and push Docker images
run: cd docker && ./release_images.sh
44 changes: 22 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
name: Release Package & Docker Images
on:
push:
branches:
- main
# - release
push:
branches:
- main
# - release
jobs:
setup-and-test:
uses: ./.github/workflows/unit-test.yml
with:
os: ubuntu-latest
secrets: inherit
# TODO: WIP
# publish-python-package:
# if: github.repository == 'Admyral-Security/admyral'
# needs:
# - setup-and-test
# uses: ./.github/workflows/publish-to-pypi.yml
# secrets: inherit
publish-docker-images:
if: github.repository == 'Admyral-Security/admyral'
needs:
- setup-and-test
uses: ./.github/workflows/publish-docker-images.yml
secrets: inherit
setup-and-test:
uses: ./.github/workflows/unit-test.yml
with:
os: ubuntu-latest
secrets: inherit
# TODO: WIP
# publish-python-package:
# if: github.repository == 'Admyral-Security/admyral'
# needs:
# - setup-and-test
# uses: ./.github/workflows/publish-to-pypi.yml
# secrets: inherit
publish-docker-images:
if: github.repository == 'Admyral-Security/admyral'
needs:
- setup-and-test
uses: ./.github/workflows/publish-docker-images.yml
secrets: inherit
132 changes: 66 additions & 66 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
name: Lint and Unit Tests
on:
workflow_call:
inputs:
os:
description: OS
required: false
default: ubuntu-latest
type: string
git-ref:
description: Git branch or ref
required: false
default: ""
type: string
workflow_call:
inputs:
os:
description: OS
required: false
default: ubuntu-latest
type: string
git-ref:
description: Git branch or ref
required: false
default: ""
type: string
jobs:
python-unit-test:
name: Python Unit Tests
runs-on: ${{ inputs.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
repository: ${{ github.repository }}
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.12
- name: Install Poetry
uses: snok/[email protected]
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: poetry install
- name: Run linter
run: poetry run ruff format --check
- name: Run linter
run: poetry run ruff check
- name: Run unit tests
run: poetry run pytest tests/
web-unit-test:
name: Web Unit Tests
runs-on: ${{ inputs.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
repository: ${{ github.repository }}
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: 18
- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 9
- name: Install dependencies
run: cd web && pnpm install
- name: Run linter
run: cd web && pnpm lint
- name: Run prettier check
run: cd web && pnpm prettier:check
- name: Run build
run: cd web && pnpm build
# TODO: activate when tests are available
# - name: Run unit tests
# run: cd web && pnpm test
python-unit-test:
name: Python Unit Tests
runs-on: ${{ inputs.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
repository: ${{ github.repository }}
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.12
- name: Install Poetry
uses: snok/[email protected]
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: poetry install
- name: Run linter
run: poetry run ruff format --check
- name: Run linter
run: poetry run ruff check
- name: Run unit tests
run: poetry run pytest tests/
web-unit-test:
name: Web Unit Tests
runs-on: ${{ inputs.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
repository: ${{ github.repository }}
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: 18
- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 9
- name: Install dependencies
run: cd web && pnpm install
- name: Run linter
run: cd web && pnpm lint
- name: Run prettier check
run: cd web && pnpm prettier:check
- name: Run build
run: cd web && pnpm build
# TODO: activate when tests are available
# - name: Run unit tests
# run: cd web && pnpm test
11 changes: 10 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
{
"tabWidth": 4,
"useTabs": true
"useTabs": true,
"overrides": [
{
"files": "*.yml",
"options": {
"tabWidth": 2,
"useTabs": false
}
}
]
}

0 comments on commit 94afdbb

Please sign in to comment.