diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index bc8d4267d98b546e96c83da5fc2f3443a1f51376..b9f4c5250284906d5a4b7c48f5aaddae19703090 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,6 +1,6 @@
 stages:
-  - build
   - test
+  - build
 
 test_api:
   stage: test
@@ -9,7 +9,7 @@ test_api:
   script:
     - docker-compose -f api/test.yml run test
   after_script:
-    - docker-compose -f api/test.yml run rm -rf api/funkwhale_api/media/*
+    - docker-compose -f api/test.yml run test rm -rf api/funkwhale_api/media/*
 
   tags:
     - dind
@@ -37,6 +37,7 @@ build_front:
   tags:
     - docker
 
+
 # When using dind, it's wise to use the overlayfs driver for
 # improved performance.
 # variables: