diff --git a/.github/workflows/ci_hub-tests.yml b/.github/workflows/ci_hub-tests.yml index 4b59c77a4..f5e7ff502 100644 --- a/.github/workflows/ci_hub-tests.yml +++ b/.github/workflows/ci_hub-tests.yml @@ -22,12 +22,6 @@ jobs: fetch-depth: 0 - name: Build release run: make release - # - name: Cache release - # uses: actions/cache@v2 - # id: cache - # with: - # path: crowdsec-xxx - # key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} - name: clone and build hub CI tool run: | git clone https://github.com/crowdsecurity/hub-tests.git @@ -43,19 +37,6 @@ jobs: cd crowdsec-${{ steps.crowdsec.outputs.tag }} ./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 ; + for i in `./cscli -c dev.yaml parsers list -a -o json | jq -r ".[].name" ` ; do + ./cscli -c dev.yaml parsers install $i ; done - - name: Setup hub ci in crowdsec - working-directory: ./crowdsec-${{ steps.crowdsec.outputs.tag }}/tests/ - run: | - cp -R ../../hub-tests/tests . - cp ../../hub-tests/main . - - name: Run the HUB CI - working-directory: ./crowdsec-${{ steps.crowdsec.outputs.tag }}/tests/ - run: | - for i in `find ./tests -mindepth 1 -maxdepth 1 -type d` ; do - echo "::group::Test-${i}" ; - ./main -c dev.yaml $i || (echo "::error file=${i}::Failed test for ${i}" ; diff ${i}"/results.json" ${i}"/results.json.fail") ; - echo "::endgroup::" ; - done ; diff --git a/.github/workflows/dispatch_ci_hub.yaml b/.github/workflows/dispatch_ci_hub.yaml new file mode 100644 index 000000000..8f7d7fe17 --- /dev/null +++ b/.github/workflows/dispatch_ci_hub.yaml @@ -0,0 +1,20 @@ +name: Dispatch to hub when creating pre-release + +on: + push: + # branches to consider in the event; optional, defaults to all + branches: + - master + +jobs: + dispatch: + name: dispatch to hub-tests + runs-on: ubuntu-latest + steps: + - name: Repository Dispatch + uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.DISPATCH_TOKEN }} + event-type: trigger_ci_hub + repository: crowdsecurity/hub + client-payload: '{"version": "${{ steps.keydb.outputs.release }}"}'