Sfoglia il codice sorgente

improve hub CI to properly build with current crowdsec code

Thibault bui Koechlin 5 anni fa
parent
commit
4acd584969
1 ha cambiato i file con 22 aggiunte e 11 eliminazioni
  1. 22 11
      .github/workflows/hub-ci.yml

+ 22 - 11
.github/workflows/hub-ci.yml

@@ -18,18 +18,29 @@ jobs:
       id: go
     - name: Check out code into the Go module directory
       uses: actions/checkout@v2
-    - name: Build
+    - name: Build release
       run: make release
-    - name: Create test env
-      run: cd crowdsec-pull && ls -l && ./test_env.sh && cd ./tests && ls -l
-    - name: Download hub tests
-      working-directory: crowdsec-pull/tests/
-      run: pwd && git clone https://github.com/crowdsecurity/hub-tests.git
-    - name: Build/prep hub tests
-      working-directory: crowdsec-pull/tests/
-      run: pwd && cd hub-tests && bash -x ./prep_tests.sh && cd ..
-    - name: Run the tests
-      working-directory: crowdsec-pull/tests/
+    - name: clone and build hub CI tool
+      run: |
+        git clone https://github.com/crowdsecurity/hub-tests.git
+        cd hub-tests
+        make
+    - name: Create crowdsec test env with all parsers from the release
+      run: |
+        cd crowdsec-pull
+        ./test_env.sh
+        cd tests
+        for i in `./cscli -c dev.yaml list parsers -a -o json | jq -r ".[].name" ` ; do 
+          ./cscli -c dev.yaml install parser $i ; 
+        done
+    - name: Setup hub ci in crowdsec
+      working-directory: ./crowdsec-pull/tests/
+      run: |
+        cd tests
+        cp -R ../../hub-tests/tests .
+        cp ../../hub-tests/main .
+    - name: Run the HUB CI
+      working-directory: ./crowdsec-pull/tests/
       run: |
         for i in `find ./tests -mindepth 1 -maxdepth 1 -type d` ; do 
           echo "::group::Test-${i}" ;