@@ -106,31 +106,41 @@ jobs:
106106 "$DOCKER_APP_IMAGE_ARM64" "$DOCKER_APP_IMAGE_X64"
107107
108108 test :
109- runs-on : ubuntu-24.04
109+ runs-on : ubuntu-latest
110110 needs :
111111 - merge
112- env :
113- COMPOSE_FILE : docker-compose.yml:docker-compose.ci.yml
114- DOCKER_APP_IMAGE : ${{ needs.merge.outputs.build-image }}
112+ container :
113+ image : ${{ needs.merge.outputs.build-image }}
114+ defaults :
115+ run :
116+ working-directory : /opt/app
117+ services :
118+ db :
119+ image : postgres
120+ env :
121+ POSTGRES_USER : root
122+ POSTGRES_PASSWORD : root
115123 steps :
116- - name : Checkout code
117- uses : actions/checkout@v4
118-
119- - name : Set up Docker Compose
120- uses : docker/setup-compose-action@v1
121-
122- - name : Login to GitHub Container Registry
123- uses : docker/login-action@v3
124+ - name : Run tests
125+ env :
126+ RAILS_ENV : test
127+ run : bundle exec rake check -t
128+
129+ - name : Run style checks
130+ run : bundle exec rubocop
131+
132+ - name : Validate database migrations
133+ env :
134+ RAILS_ENV : production
135+ DISABLE_DATABASE_ENVIRONMENT_CHECK : 1
136+ run : rails --trace db:drop db:create db:migrate
137+
138+ - name : Upload artifacts
139+ if : ${{ always() }}
140+ uses : actions/upload-artifact@v4
124141 with :
125- registry : ghcr.io
126- username : ${{ github.actor }}
127- password : ${{ secrets.GITHUB_TOKEN }}
128-
129- - name : Run the test script
130- run : |
131- docker compose run --rm --user root app chown -R avplayer:avplayer artifacts
132- docker compose up --detach --wait
133- docker compose exec app bin/test
142+ name : artifacts
143+ path : artifacts/**
134144
135145 push :
136146 runs-on : ubuntu-24.04
0 commit comments