ci: disable tests in CI, rely on precommit hooks instead
Tests are still enforced locally via precommit hooks (mix precommit). CI now only: - Builds Docker image - Pushes to registry - Updates deployment Expected CI time: 10-12 minutes (down from 26 minutes) Trade-off: Faster CI feedback vs relying on local testing before push.
This commit is contained in:
parent
b0fcfb800f
commit
7a13368098
1 changed files with 1 additions and 54 deletions
|
|
@ -8,71 +8,18 @@ on:
|
|||
env:
|
||||
DOCKER_BUILDKIT: 1
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
MIX_ENV: test
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test-and-build:
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
env:
|
||||
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/towerops_test
|
||||
ERL_AFLAGS: "-kernel shell_history enabled"
|
||||
services:
|
||||
postgres:
|
||||
image: timescale/timescaledb:latest-pg17
|
||||
env:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: towerops_test
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 3s
|
||||
--health-timeout 2s
|
||||
--health-retries 10
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Elixir
|
||||
uses: https://github.com/erlef/setup-beam@v1
|
||||
with:
|
||||
otp-version: '28.3'
|
||||
elixir-version: '1.19.5'
|
||||
version-type: strict
|
||||
|
||||
- name: Restore caches
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.hex
|
||||
~/.mix
|
||||
deps
|
||||
_build
|
||||
native/towerops_native/target
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}-${{ hashFiles('lib/**/*.ex') }}-${{ hashFiles('native/**/*.rs') }}-elixir-1.19.5-otp-28.3
|
||||
restore-keys: |
|
||||
${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}-
|
||||
${{ runner.os }}-mix-
|
||||
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends libsnmp-dev snmp-mibs-downloader postgresql-client
|
||||
|
||||
- name: Install Elixir dependencies
|
||||
run: mix deps.get --only test
|
||||
|
||||
- name: Compile and test
|
||||
run: |
|
||||
mix compile --warnings-as-errors
|
||||
mix test --warnings-as-errors --max-cases 3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue