Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
059e856
Removing directory with GH action
rafal-k Feb 16, 2026
06e4e38
Add a test workflow - initial commit.
rafal-k Feb 17, 2026
b0d2f60
add module testing and linting workflows
rafal-k Feb 17, 2026
d564af4
test: add a comment to trigger tests in pos-module-user
rafal-k Feb 17, 2026
0295a14
test: remove payments module from platformOS test job
rafal-k Feb 17, 2026
752835c
test: use seed script to deploy pos-module-user
rafal-k Feb 17, 2026
d773e66
test: split workflows to avoid CI instance conflicts
rafal-k Feb 18, 2026
b503469
test: added a test-triggering-comment to a different module
rafal-k Feb 18, 2026
581096b
test: use deploy-script pattern for module-specific deployment
rafal-k Feb 18, 2026
a9dd386
use repo variable to define PW container and do not install dependencies
rafal-k Feb 18, 2026
3a11d30
test: split E2E workflow into deploy, test, and cleanup jobs
rafal-k Feb 18, 2026
d33532d
update version of reserve-instance action and add NPM_CONFIG_CACHE var
rafal-k Feb 19, 2026
d3bf03e
test: align E2E deploy job with reserve-and-deploy-cs pattern
rafal-k Feb 21, 2026
2cad645
test: update E2E workflow environment variables
rafal-k Feb 21, 2026
958c8ee
test: pass mpkit-url from deploy to test via job outputs
rafal-k Feb 21, 2026
7806d8c
test: rename deploy job to reserve-and-deploy in E2E workflow
rafal-k Feb 21, 2026
c89ee72
test: update job dependencies after renaming deploy job
rafal-k Feb 21, 2026
7c5697d
fix: move comment outside parse_json block in chat permissions
rafal-k Feb 21, 2026
bb40dc3
test: refactor E2E workflow to use dynamic matrix
rafal-k Feb 21, 2026
0760d85
refactor: eliminate boilerplate in set-matrix steps
rafal-k Feb 21, 2026
a94fb34
lint: improve summary generation error handling and debugging
rafal-k Feb 21, 2026
b82bea4
test: add comment to one of the liquid files to trigger test workflow
rafal-k Feb 21, 2026
e5eee61
fix: prevent parallel CI instance reservations in E2E workflow
rafal-k Feb 21, 2026
d107831
fix: restructure E2E workflow to prevent instance reservation conflicts
rafal-k Feb 21, 2026
940c8ae
fix: resolve E2E workflow instance conflicts and Playwright version i…
rafal-k Feb 21, 2026
ce7fc32
temporarily disable automatic triggers for test.yml
rafal-k Feb 21, 2026
8b9eae2
remove the comments used to trigger test workflows
rafal-k Feb 21, 2026
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
170 changes: 170 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
name: Lint modules

on:
pull_request:
branches: [ master ]
paths-ignore:
- "**/README.md"
push:
paths-ignore:
- "**/README.md"
workflow_dispatch:

jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
github_token: ${{ github.token }}
paths_ignore: '["**/README.md"]'
do_not_skip: '["push"]'

detect-changes:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
outputs:
changed-modules: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4

- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
payments:
- 'pos-module-payments/**'
user:
- 'pos-module-user/**'
chat:
- 'pos-module-chat/**'
common-styling:
- 'pos-module-common-styling/**'
tests:
- 'pos-module-tests/**'
core:
- 'pos-module-core/**'
oauth-facebook:
- 'pos-module-oauth-facebook/**'
oauth-github:
- 'pos-module-oauth-github/**'
oauth-google:
- 'pos-module-oauth-google/**'
openai:
- 'pos-module-openai/**'
reports:
- 'pos-module-reports/**'
data-export-api:
- 'pos-module-data-export-api/**'
payments-stripe:
- 'pos-module-payments-stripe/**'
payments-example-gateway:
- 'pos-module-payments-example-gateway/**'

- name: Set matrix for changed modules
id: set-matrix
run: |
# Extract module names where filter output is "true"
modules=$(echo '${{ toJSON(steps.filter.outputs) }}' | jq -c '[to_entries[] | select(.value == "true") | .key]')

echo "matrix=$modules" >> $GITHUB_OUTPUT
echo "Changed modules for linting: $modules"

lint-platformos-check:
needs: detect-changes
if: needs.detect-changes.outputs.changed-modules != '[]'
runs-on: ubuntu-latest
strategy:
matrix:
module: ${{ fromJSON(needs.detect-changes.outputs.changed-modules) }}
fail-fast: false
env:
CI: true
PLATFORMOS_CHECK_DEBUG: true
DOCKER_WORKSPACE: ${{ github.workspace }}/pos-module-${{ matrix.module }}
LOGS_DIR: ${{ github.workspace }}/pos-module-${{ matrix.module }}/logs
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up logs directory
run: |
mkdir -p ${{ env.LOGS_DIR }}
chmod -R 777 ${{ env.LOGS_DIR }}

- name: Start PlatformOS LSP
id: start_lsp
run: |
docker run -i \
-v ${{ env.DOCKER_WORKSPACE }}:${{ env.DOCKER_WORKSPACE }} \
-w ${{ env.DOCKER_WORKSPACE }} \
-e PLATFORMOS_CHECK_DEBUG=${{ env.PLATFORMOS_CHECK_DEBUG }} \
-e PLATFORMOS_CHECK_DEBUG_LOG_FILE=${{ env.LOGS_DIR }}/platformos-lsp.log \
platformos/platformos-lsp:latest

- name: Run platformos-check
if: steps.start_lsp.outcome == 'success'
id: run_check
run: |
set +e # Disable exit on error
docker run -i \
-v ${{ env.DOCKER_WORKSPACE }}:${{ env.DOCKER_WORKSPACE }} \
-w ${{ env.DOCKER_WORKSPACE }} \
-e PLATFORMOS_CHECK_DEBUG=${{ env.PLATFORMOS_CHECK_DEBUG }} \
-e PLATFORMOS_CHECK_DEBUG_LOG_FILE=${{ env.LOGS_DIR }}/platformos-check.log \
platformos/platformos-check:latest -o json > ${{ env.LOGS_DIR }}/platformos-check-raw.json
docker_exit_code=$?
set -e # Re-enable exit on error

jq . ${{ env.LOGS_DIR }}/platformos-check-raw.json | tee ${{ env.LOGS_DIR }}/platformos-check.json

exit $docker_exit_code

- name: Upload logs
if: always() && steps.run_check.outcome != 'skipped'
uses: actions/upload-artifact@v4
with:
name: platformos_check_logs_${{ matrix.module }}_${{ github.run_id }}
path: |
${{ env.LOGS_DIR }}/platformos-lsp.log
${{ env.LOGS_DIR }}/platformos-check.json
${{ env.LOGS_DIR }}/platformos-check-raw.json

- name: Generate summary
if: always() && steps.run_check.outcome != 'skipped'
run: |
echo "# PlatformOS Check Summary - ${{ matrix.module }} :checkered_flag:" >> $GITHUB_STEP_SUMMARY
echo "## Result: ${{ steps.run_check.outcome }} ${{ env.RESULT_ICON }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

if [ -f "${{ env.LOGS_DIR }}/platformos-check.json" ]; then
echo "## Issues Found" >> $GITHUB_STEP_SUMMARY
echo "| File | Line | Column | Severity | Check | Message |" >> $GITHUB_STEP_SUMMARY
echo "|------|------|--------|----------|-------|---------|" >> $GITHUB_STEP_SUMMARY

# Try to parse and add issues
if jq -r '.[] | .path as $file | .offenses[] | "| \($file) | \(.start_row) | \(.start_column) | \(.severity) | \(.check) | \(.message) |"' ${{ env.LOGS_DIR }}/platformos-check.json >> $GITHUB_STEP_SUMMARY 2>&1; then
echo "Issues table generated successfully"
else
echo "| N/A | N/A | N/A | N/A | N/A | Failed to parse JSON - see logs for details |" >> $GITHUB_STEP_SUMMARY
echo "JSON parse error. File contents:" >> $GITHUB_STEP_SUMMARY
echo '```json' >> $GITHUB_STEP_SUMMARY
cat ${{ env.LOGS_DIR }}/platformos-check.json >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi
else
echo "## No output file found" >> $GITHUB_STEP_SUMMARY
echo "Expected location: ${{ env.LOGS_DIR }}/platformos-check.json" >> $GITHUB_STEP_SUMMARY
fi
env:
RESULT_ICON: ${{ steps.run_check.outcome == 'success' && ':white_check_mark:' || ':x:' }}

- name: Fail job if platformos-check failed
if: always() && steps.run_check.outcome == 'failure'
run: |
echo "platformos-check failed — marking job as failed"
exit 1
150 changes: 150 additions & 0 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
name: E2E tests
on:
pull_request:
branches: [ master ]
paths-ignore:
- "**/README.md"
push:
paths-ignore:
- "**/README.md"
workflow_dispatch:

jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
github_token: ${{ github.token }}
paths_ignore: '["**/README.md"]'
do_not_skip: '["push"]'

detect-changes:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
outputs:
changed-modules: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4

- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
user:
- 'pos-module-user/**'
chat:
- 'pos-module-chat/**'
common-styling:
- 'pos-module-common-styling/**'

- name: Set matrix for changed modules
id: set-matrix
run: |
# Define module configurations
cat > /tmp/module-config.json << 'EOF'
{
"user": {
"module": "user",
"path": "pos-module-user",
"deploy-script": "rm app/pos-modules.* || true\nsh ./tests/data/seed/seed.sh",
"test-commands": "npm run admin-panel-pw-tests\nnpm run pw-tests"
},
"chat": {
"module": "chat",
"path": "pos-module-chat",
"deploy-script": "rm app/pos-modules.* || true\nsh ./tests/data/seed/seed.sh",
"test-commands": "npm run pw-tests"
},
"common-styling": {
"module": "common-styling",
"path": "pos-module-common-styling",
"deploy-script": "pos-cli data clean --include-schema --auto-confirm\npos-cli deploy",
"test-commands": "npm run pw-tests"
}
}
EOF

# Extract changed modules and map to their configurations
modules=$(echo '${{ toJSON(steps.filter.outputs) }}' | \
jq -c --slurpfile config /tmp/module-config.json \
'[to_entries[] | select(.value == "true") | .key as $m | $config[0][$m] | select(. != null)]')

echo "matrix=$modules" >> $GITHUB_OUTPUT
echo "Changed modules matrix: $modules"

test-e2e:
needs: detect-changes
if: needs.detect-changes.outputs.changed-modules != '[]'
runs-on: ubuntu-latest
container: ${{ vars.PW_CONTAINER }}
strategy:
matrix:
include: ${{ fromJSON(needs.detect-changes.outputs.changed-modules) }}
max-parallel: 1
fail-fast: false
timeout-minutes: 60
env:
CI: true
MPKIT_EMAIL: ${{ secrets.MPKIT_EMAIL }}
NPM_CONFIG_CACHE: ${{ github.workspace }}/.npm
E2E_TEST_PASSWORD: ${{ secrets.E2E_TEST_PASSWORD }}
HTML_ATTACHMENTS_BASE_URL: ${{ vars.HTML_ATTACHMENTS_BASE_URL }}
TEST_REPORT_MPKIT_URL: ${{ vars.TEST_REPORT_MPKIT_URL }}
TEST_REPORT_MPKIT_TOKEN: ${{ secrets.TEST_REPORT_MPKIT_TOKEN }}
steps:
- name: Reserve CI instance
id: reserve
uses: Platform-OS/ci-repository-reserve-instance-url@0.1.2
with:
repository-url: ${{ vars.CI_PS_REPOSITORY_URL }}
method: reserve
pos-ci-repo-token: ${{ secrets.POS_CI_PS_REPO_ACCESS_TOKEN }}

- name: Get MPKIT token
id: get-token
uses: Platform-OS/ci-repository-reserve-instance-url@0.1.2
with:
method: get-token
repository-url: ${{ vars.CI_PS_REPOSITORY_URL }}
pos-ci-repo-token: ${{ secrets.POS_CI_PS_REPO_ACCESS_TOKEN }}

- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref_name }}

- uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Deploy module
timeout-minutes: 10
shell: sh
env:
MPKIT_URL: ${{ steps.reserve.outputs.mpkit-url }}
MPKIT_TOKEN: ${{ steps.get-token.outputs.mpkit-token }}
working-directory: ${{ matrix.path }}
run: |
set -eu
${{ matrix.deploy-script }}

- name: Run Playwright tests
shell: sh
env:
MPKIT_URL: ${{ steps.reserve.outputs.mpkit-url }}
working-directory: ${{ matrix.path }}
run: |
set -eu
${{ matrix.test-commands }}

- name: Release CI instance
if: always()
uses: Platform-OS/ci-repository-reserve-instance-url@0.1.2
with:
method: release
repository-url: ${{ vars.CI_PS_REPOSITORY_URL }}
pos-ci-repo-token: ${{ secrets.POS_CI_PS_REPO_ACCESS_TOKEN }}
Loading