refactor: remove test.yaml workflow
Simplified CI/CD to two workflows: - staging.yaml: Deploys to Dokku on main push (no tests) - production.yaml: Full test suite + deploy on production push Main branch deploys immediately to staging for fast iteration. Production branch has comprehensive test gates before deployment.
This commit is contained in:
parent
d52ab0eceb
commit
db96845250
1 changed files with 0 additions and 84 deletions
|
|
@ -1,84 +0,0 @@
|
|||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- production
|
||||
|
||||
env:
|
||||
MIX_ENV: test
|
||||
|
||||
jobs:
|
||||
test-exunit:
|
||||
name: ExUnit Tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: timescale/timescaledb:latest-pg16
|
||||
env:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: towerops_test
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: Set up Elixir
|
||||
uses: https://github.com/erlef/setup-beam@v1
|
||||
with:
|
||||
version-type: strict
|
||||
elixir-version: '1.18.1'
|
||||
otp-version: '27.2'
|
||||
|
||||
- name: Cache deps
|
||||
uses: https://github.com/actions/cache@v4
|
||||
with:
|
||||
path: deps
|
||||
key: ${{ runner.os }}-deps-${{ hashFiles('mix.lock') }}
|
||||
restore-keys: ${{ runner.os }}-deps-
|
||||
|
||||
- name: Cache _build
|
||||
uses: https://github.com/actions/cache@v4
|
||||
with:
|
||||
path: _build
|
||||
key: ${{ runner.os }}-build-${{ hashFiles('lib/**/*.ex') }}-${{ hashFiles('mix.lock') }}
|
||||
restore-keys: ${{ runner.os }}-build-
|
||||
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y openssl libssl1.1 libssl-dev libsnmp-dev snmp-mibs-downloader postgresql-client
|
||||
|
||||
- name: Install dependencies
|
||||
run: mix deps.get
|
||||
|
||||
- name: Check formatting
|
||||
run: mix format --check-formatted
|
||||
|
||||
- name: Compile (warnings as errors)
|
||||
run: mix compile --warnings-as-errors
|
||||
|
||||
- name: Run tests with coverage
|
||||
run: mix test --cover
|
||||
|
||||
- name: Run Credo
|
||||
run: mix credo --strict
|
||||
|
||||
- name: Upload coverage reports
|
||||
if: always()
|
||||
uses: https://github.com/actions/upload-artifact@v4
|
||||
with:
|
||||
name: coverage-report
|
||||
path: cover/
|
||||
retention-days: 7
|
||||
Loading…
Add table
Reference in a new issue