name: Main on: push: branches: [ "*" ] pull_request: branches: [ "*" ] jobs: build: name: Build runs-on: ubuntu-latest steps: - name: Set up Javascript/Node uses: actions/setup-node@v2 with: node-version: '14' - name: Check out code uses: actions/checkout@v2 with: fetch-depth: '0' - name: Cache multiple paths uses: actions/cache@v2 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-node- - name: Build run: | npm install npm run compile - name: Upload Artifact uses: actions/upload-artifact@v2 if: ${{ always() }} with: name: logs path: ~/.npm/_logs/* retention-days: 14 test: name: Test runs-on: ubuntu-latest steps: - name: Set up Javascript/Node uses: actions/setup-node@v2 with: node-version: '14' - name: Check out code uses: actions/checkout@v2 with: fetch-depth: '0' - name: Cache multiple paths uses: actions/cache@v2 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-node- - name: Install run: | npm install - name: Tests run: | npm run test-core npm run test-generate npm run test-reports npm run test-neighbor npm run test-dump - name: Tests RPKI run: | npm run test-rpki - name: Tests Proxy run: | npm install -g anyproxy nohup anyproxy --port 8001 & ANYPROXY_PID=$! npm run test-proxy kill $ANYPROXY_PID - name: Tests NPM run: | npm run test-npm - name: Tests Kafka run: | sudo apt-get -y install tar sudo apt-get -y install wget wget -O kafka.tgz https://dlcdn.apache.org/kafka/3.1.0/kafka_2.13-3.1.0.tgz mkdir kafka && tar -xzf kafka.tgz -C kafka --strip-components=1 nohup ./kafka/bin/zookeeper-server-start.sh ./kafka/config/zookeeper.properties & nohup ./kafka/bin/kafka-server-start.sh ./kafka/config/server.properties & nohup ./kafka/bin/kafka-topics.sh --create --topic bgpalerter --bootstrap-server 0.0.0.0:9092 --replication-factor 1 --partitions 1 & sleep 30 && npm run test-kafka - name: Upload Artifact uses: actions/upload-artifact@v2 if: ${{ always() }} with: name: logs path: ~/.npm/_logs/* retention-days: 14