Skip to content

Commit

Permalink
pre-committ
Browse files Browse the repository at this point in the history
  • Loading branch information
NxPKG committed Nov 25, 2024
1 parent b95ad3b commit 0ecc85b
Show file tree
Hide file tree
Showing 59 changed files with 2,686 additions and 2,813 deletions.
8 changes: 0 additions & 8 deletions .env
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
# Domain
# This would be set to the production domain with an env var on deployment
# used by Traefik to transmit traffic and aqcuire TLS certificates
DOMAIN=localhost
# To test the local Traefik config
# DOMAIN=localhost.khulnasoft.com

# Used by the backend to generate links in emails to the frontend
FRONTEND_HOST=http://localhost:5173
# In staging and production, set this env var to the frontend host, e.g.
# FRONTEND_HOST=https://dashboard.example.com

# Environment: local, staging, production
ENVIRONMENT=local
Expand Down
12 changes: 6 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
version: 2
updates:
# GitHub Actions
- package-ecosystem: github-actions
directory: /
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
interval: "daily"
commit-message:
prefix:
# Python
- package-ecosystem: pip
directory: /
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: daily
interval: "daily"
commit-message:
prefix:
25 changes: 0 additions & 25 deletions .github/labeler.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/add-to-project.yml

This file was deleted.

57 changes: 0 additions & 57 deletions .github/workflows/generate-client.yml

This file was deleted.

26 changes: 5 additions & 21 deletions .github/workflows/issue-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,30 @@ name: Issue Manager

on:
schedule:
- cron: "21 17 * * *"
- cron: "0 0 * * *"
issue_comment:
types:
- created
- edited
issues:
types:
- labeled
pull_request_target:
types:
- labeled
workflow_dispatch:

permissions:
issues: write
pull-requests: write

jobs:
issue-manager:
if: github.repository_owner == 'readyapi'
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: khulnasoft/issue-manager@0.5.1
- uses: khulnasoft/issue-manager@0.5.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
config: >
{
"answered": {
"users": ["khulnasoft"],
"delay": 864000,
"message": "Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs."
},
"waiting": {
"delay": 2628000,
"message": "As this PR has been waiting for the original user for a while but seems to be inactive, it's now going to be closed. But if there's anyone interested, feel free to create a new PR."
},
"invalid": {
"delay": 0,
"message": "This was marked as invalid and will be closed now. If this is an error, please provide additional details."
"message": "Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues."
}
}
33 changes: 0 additions & 33 deletions .github/workflows/labeler.yml

This file was deleted.

13 changes: 7 additions & 6 deletions .github/workflows/latest-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ on:
description: PR number
required: true
debug_enabled:
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: "false"
default: 'false'

jobs:
latest-changes:
Expand All @@ -30,11 +30,12 @@ jobs:
with:
# To allow latest-changes to commit to the main branch
token: ${{ secrets.LATEST_CHANGES }}
- uses: khulnasoft/latest-changes@0.3.2
- uses: docker://khulnasoft/latest-changes:0.3.0
# - uses: khulnasoft/latest-changes@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
latest_changes_file: ./release-notes.md
latest_changes_header: "## Latest Changes"
end_regex: "^## "
latest_changes_header: '## Latest Changes'
end_regex: '^## '
debug_logs: true
label_header_prefix: "### "
label_header_prefix: '### '
28 changes: 0 additions & 28 deletions .github/workflows/lint-backend.yml

This file was deleted.

85 changes: 16 additions & 69 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,10 @@ on:
default: 'false'

jobs:
changes:
runs-on: ubuntu-latest
# Set job outputs to values from filter step
outputs:
changed: ${{ steps.filter.outputs.changed }}
steps:
- uses: actions/checkout@v4
# For pull requests it's not necessary to checkout the code but for the main branch it is
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
changed:
- backend/**
- frontend/**
- .env
- docker-compose*.yml
- .github/workflows/playwright.yml

test-playwright:
needs:
- changes
if: ${{ needs.changes.outputs.changed == 'true' }}
test:
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
matrix:
shardIndex: [1, 2, 3, 4]
shardTotal: [4]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -59,61 +33,34 @@ jobs:
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
with:
limit-access-to-actor: true
- run: docker compose build
- run: docker compose down -v --remove-orphans
- name: Run Playwright tests
run: docker compose run --rm playwright npx playwright test --fail-on-flaky-tests --trace=retain-on-failure --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
- run: docker compose down -v --remove-orphans
- name: Upload blob report to GitHub Actions Artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: blob-report-${{ matrix.shardIndex }}
path: frontend/blob-report
include-hidden-files: true
retention-days: 1

merge-playwright-reports:
needs:
- test-playwright
- changes
# Merge reports after playwright-tests, even if some shards have failed
if: ${{ !cancelled() && needs.changes.outputs.changed == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
working-directory: frontend
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: frontend/all-blob-reports
pattern: blob-report-*
merge-multiple: true
- name: Merge into HTML Report
run: npx playwright merge-reports --reporter html ./all-blob-reports
- name: Install Playwright Browsers
run: npx playwright install --with-deps
working-directory: frontend
- name: Upload HTML report
uses: actions/upload-artifact@v4
- run: docker compose build
- run: docker compose down -v --remove-orphans
- run: docker compose up -d
- name: Run Playwright tests
run: npx playwright test
working-directory: frontend
- run: docker compose down -v --remove-orphans
- uses: actions/upload-artifact@v4
if: always()
with:
name: html-report--attempt-${{ github.run_attempt }}
path: frontend/playwright-report
name: playwright-report
path: frontend/playwright-report/
retention-days: 30
include-hidden-files: true

# https://github.com/marketplace/actions/alls-green#why
alls-green-playwright: # This job does nothing and is only used for the branch protection
e2e-alls-green: # This job does nothing and is only used for the branch protection
if: always()
needs:
- test-playwright
- test
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
allowed-skips: test-playwright
Loading

0 comments on commit 0ecc85b

Please sign in to comment.