Commit graph

52 commits

Author SHA1 Message Date
79be23813e
Improve CI/CD stability for frontend integration tests
Address browser testing reliability in CI environments:

## CI/CD Improvements
- **ChromeDriver**: Use latest stable version instead of pinned version for better compatibility
- **Timeouts**: Add 10-minute timeout for integration tests to prevent CI hangs
- **Environment Variables**: Configure WALLABY_MAX_WAIT_TIME for CI-specific timeouts

## Wallaby Configuration Enhancements
- **Chrome Args**: Add CI-stable Chrome options (--no-sandbox, --disable-dev-shm-usage)
- **Window Size**: Set consistent 1280x720 window size for reproducible tests
- **Dynamic Timeouts**: Environment-configurable max wait time with sensible defaults
- **Pool Size**: Limit to single browser instance to prevent resource conflicts

## Benefits
-  More reliable test execution in CI environments
-  Better error handling and timeout management
-  Consistent browser behavior across environments
-  Reduced flakiness from resource constraints

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-29 12:26:35 -05:00
9a63c9ed63
Add comprehensive frontend integration tests with Wallaby
This commit implements browser-based integration testing for the Phoenix LiveView
application using Wallaby and ChromeDriver to test the complete user experience
including JavaScript interactions.

## Changes Made

### Testing Infrastructure
- Add Wallaby dependency for browser automation testing
- Configure Chrome driver with headless mode for CI/CD
- Set up Phoenix server integration for test environment
- Enable screenshot capture on test failures

### Integration Tests
- `test/integration/simple_integration_test.exs` - Basic homepage functionality
- `test/integration/map_integration_test.exs` - Map interface and routing tests
- Tests validate page loading, content rendering, and navigation

### CI/CD Integration
- Update GitHub Actions workflow to install ChromeDriver
- Add separate integration test step in CI pipeline
- Configure headless Chrome for automated testing

### Configuration Updates
- Enable Phoenix server in test environment for Wallaby
- Configure Wallaby with proper base URL and screenshot settings
- Initialize Wallaby application in test helper

## Features Tested
-  Homepage loads with APRS content
-  Main page structure renders correctly
-  Route navigation functions properly
-  Basic Phoenix LiveView functionality

## Next Steps
This provides a solid foundation for expanding to test:
- Interactive map controls and JavaScript functionality
- Real-time packet updates via LiveView PubSub
- User authentication flows and form submissions
- Mobile responsive behavior

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-29 12:21:53 -05:00
7e4bbbaff5
Fix deployment timestamp always showing 'less than a minute ago' in k8s
Previously, the deployment timestamp was set to DateTime.utc_now() when
the application started, which meant it would always show as recent in
k8s environments where pods are recreated on each deployment.

This commit:
- Updates Release.init() to check for DEPLOYED_AT environment variable
- Falls back to current time if env var is not set (backwards compatible)
- Adds proper ISO8601 timestamp parsing with error handling
- Updates GitHub Actions deploy workflow to set DEPLOYED_AT during deployment
- Creates k8s patch file for future manual deployments

The deployment timestamp will now persist across pod restarts in k8s,
showing the actual deployment time rather than pod startup time.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 12:06:12 -05:00
ece5c82e99
bump elixir version for ci 2025-07-28 12:01:34 -05:00
b09df98391
Remove Gleam from CI workflow
- Remove Gleam setup from GitHub Actions workflow
- Remove mix_gleam installation step
- Remove Gleam package caching
- Remove mix gleam_compile step

This completes the removal of all Gleam-related code and tooling.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-27 11:21:00 -05:00
160c4fdc0e
Fix GitHub Actions Docker build cache configuration
- Re-add Docker Buildx setup (required for cache)
- Use 'type=inline' for cache-to (embeds cache in image)
- Cache from the latest image instead of separate buildcache tag

This fixes the 'Cache export is not supported' error.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-26 16:27:06 -05:00
1cfeaf556e
Simplify Dockerfile for much faster builds
- Remove BuildKit advanced features that were slowing builds
- Remove multi-platform builds (only build for amd64)
- Remove security scanning stage
- Remove complex caching mounts
- Simplify to basic 2-stage build
- Use registry cache instead of GitHub Actions cache

This should reduce build time from 10+ minutes to 2-3 minutes.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-26 16:22:38 -05:00
6f6a04b485
Implement all Docker performance optimizations
Performance improvements:
- Add BuildKit syntax for advanced features
- Implement 3-stage build (deps, builder, runtime) for better caching
- Add cache mounts for apt, hex, rebar, and build directories
- Use heredoc syntax for complex RUN commands
- Enable multi-platform builds (amd64 and arm64)
- Add GitHub Actions cache for Docker layers
- Reorder COPY commands by change frequency
- Add optional security scanning stage with Trivy

Build time improvements:
- 30-50% faster rebuilds when only code changes
- Dependency layer cached separately
- APT package cache persists between builds
- Mix dependencies cached

Additional optimizations:
- More comprehensive .dockerignore file
- Remove more unnecessary files from runtime image
- Add proper container labels
- Use dedicated elixir user with UID 1001

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-26 16:12:47 -05:00
4f5f26287a
Add concurrency control to deploy workflow
- Cancels any in-progress deployment when a new commit is pushed
- Prevents multiple deployments from running simultaneously
- Uses concurrency group based on branch ref
- Saves CI/CD resources and prevents conflicting deployments

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-26 16:05:03 -05:00
1605afd5b0
Remove rollout wait from GitHub deployment workflow
The CI/CD pipeline now initiates the deployment but doesn't wait for it to complete, allowing the workflow to finish quickly even if pods take time to start.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-26 16:01:49 -05:00
904b555ca2
Fix GitHub Actions deployment to use StatefulSet
Update kubectl commands in deploy workflow to target statefulset
instead of deployment, matching the recent migration to StatefulSet.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-25 12:27:23 -05:00
be7e14b323
Fix MicE struct compilation errors by enabling submodule checkout
Updates Claude workflow to pull git submodules recursively, which resolves
compilation errors for Aprs.Types.MicE struct that is defined in the
vendor/aprs submodule.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-25 12:22:47 -05:00
beb40cf625
Add rollout restart to deployment workflow
Force k3s to pull the latest image by adding rollout restart
after setting the image. This ensures the cluster always runs
the most recent build even when using the :latest tag.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-24 19:46:05 -05:00
fe67866018
Update k3s deployment to use latest tag and correct registry
- Changed kubectl deployment command to use :latest tag
- Updated k8s deployment manifests to use ghcr.io/aprsme/aprs.me:latest
- This ensures k3s always pulls the most recent image from GitHub Container Registry

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-24 19:34:18 -05:00
816d699298
Fix k3s deployment to use correct Docker image tag
The deployment was using raw SHA but the Docker metadata action creates
tags with 'main-' prefix for the main branch. Updated kubectl command
to use the correct tag format: main-${github.sha}

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-24 19:28:28 -05:00
e84dcb6bc0
clone submodules recursively 2025-07-24 18:20:56 -05:00
b8771afd14
remove docker security scan 2025-07-24 17:43:49 -05:00
3f9f906858
cleanup 2025-07-24 17:18:02 -05:00
99d277f383
add deploy 2025-07-24 17:08:24 -05:00
746db1a4c2
Fix GitHub Action gleam setup error
Replace deprecated gleam-lang/setup-gleam@v1 with erlef/setup-beam which supports
Gleam alongside Elixir and Erlang. This consolidates setup steps and uses the
actively maintained action.

The previous gleam-lang/setup-gleam action is deprecated and v1 tag doesn't exist,
causing CI failures. erlef/setup-beam is the recommended replacement.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-21 08:34:10 -05:00
00a8f996f4
Add Gleam language integration to Elixir project
- Rename Gleam module from encoding_simple to encoding
- Move Gleam files from src/aprs/ to src/aprsme/ to match project namespace
- Create custom Mix task for Gleam compilation (lib/mix/tasks/gleam_compile.ex)
- Update EncodingUtils to wrap Gleam implementation instead of pure Elixir
- Add Gleam dependencies to mix.exs and configure build paths
- Update Mix aliases to include Gleam compilation in test and compile tasks
- Add Gleam support to GitHub Actions CI workflow with caching
- Add GLEAM_INTEGRATION.md documentation
- All 357 tests passing with Gleam integration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18 13:58:21 -05:00
Graham McIntire
702dcef1f2 Claude Code Review workflow 2025-07-10 11:49:14 -05:00
Graham McIntire
b14727a282 Claude PR Assistant workflow 2025-07-10 11:49:12 -05:00
b2c5414602
ci fixes 2025-07-09 17:08:12 -05:00
20d6e3fc16
fix github ci a bit 2025-07-09 17:03:02 -05:00
8eb1e90622
use postgis for testing 2025-07-09 16:48:55 -05:00
ce7c50caa1
refactor to use external parser 2025-06-24 14:22:09 -05:00
7cdc03361c
add live dashboard in prod 2025-06-19 10:00:31 -05:00
d3924ea395
bump upload-sarif version 2025-06-15 19:44:21 -05:00
221f7faaa9
ensure previous ci runs get stopped on new runs 2025-06-15 19:39:51 -05:00
5347c7afec
remove k3s deploy 2025-06-15 19:38:13 -05:00
2206ac1965
update horusec scan 2025-06-15 19:37:40 -05:00
b8f61a9a06
docker updates 2025-06-15 17:44:31 -05:00
7a8a5443f6
docker updates 2025-06-15 17:39:28 -05:00
c5617b6e8d
docker updates 2025-06-15 17:36:51 -05:00
e8e86eb5b5 add horusec to ci
Former-commit-id: 072958df9e98bf11911c067c1231d1080d80bf5c
2025-06-15 17:19:26 -05:00
1df2f4a716 add security scan for docker 2025-06-15 10:43:38 -05:00
4a6665ac76 remove fly deploy 2025-06-13 15:10:45 -05:00
8a38859990 fly things 2025-06-13 15:10:29 -05:00
58774baca1 ci test 2025-06-13 14:39:37 -05:00
c13acd6a6f ci test 2025-06-13 14:13:54 -05:00
bda6ec4d68 ci test 2025-06-13 14:09:15 -05:00
76b7ce427a ci test 2025-06-13 14:07:43 -05:00
8f8271af06 ci test 2025-06-13 14:01:17 -05:00
26a92381c6 ci test 2025-06-13 13:59:01 -05:00
a42676cd2e add tailscale 2025-06-13 13:38:51 -05:00
308e216fe0 bump elixir ci version 2025-06-13 13:27:14 -05:00
google-labs-jules[bot]
1badb192b5 feat: Implement K3s deployment with GitHub Actions CI/CD
This commit introduces a complete setup for deploying the Phoenix application
to a K3s Kubernetes cluster, along with a GitHub Actions workflow for
automated builds and deployments.

Key changes include:

- **Kubernetes Manifests (`k8s/`)**:
    - Namespace (`aprs-app`) for isolating application resources.
    - PostgreSQL setup: PersistentVolumeClaim, Deployment, and Service.
    - Application setup: Deployment (with init container for migrations) and
      Service (NodePort).
    - An example secrets file (`k8s/secrets.yaml.example`) for configuration.
    - `.gitignore` updated to exclude `k8s/secrets.yaml`.

- **GitHub Actions Workflow (`.github/workflows/deploy-k3s.yaml`)**:
    - Builds the Docker image on pushes to the main branch.
    - Pushes the image to GitHub Container Registry (GHCR).
    - Deploys the application to K3s by applying the manifests.
    - Dynamically updates the application deployment with the correct image tag.
    - Requires `KUBE_CONFIG_DATA` GitHub secret for K3s authentication.

- **Application Configuration (`config/runtime.exs`)**:
    - Commented out `libcluster` configuration specific to Fly.io to prevent
      issues in a standard K3s environment.

- **Documentation (`README.md`)**:
    - Added a new "Kubernetes (K3s) Deployment" section detailing:
        - Prerequisites and initial setup (GitHub & K8s secrets).
        - Workflow overview.
        - Application configuration notes (health checks, migrations).
        - Instructions for accessing the application.

This setup provides a robust foundation for CI/CD and running the
application in a self-hosted K3s environment.
2025-06-13 18:18:34 +00:00
8b28c57a74 update github ci 2023-12-17 12:14:47 -06:00
9b51afa81c remove coveralls for now 2023-01-31 14:18:39 -06:00