From 048c8330d3e8033c8c773a370646c998173935a7 Mon Sep 17 00:00:00 2001 From: Louis Date: Tue, 5 Jan 2021 15:23:31 +0100 Subject: [PATCH] add github actions (#446) --- .github/workflows/main.yml | 111 +++++++++++++++++++++++++++++++++++++ .travis.yml | 45 --------------- AUTHORS | 51 ++++++++--------- README.md | 2 +- 4 files changed, 138 insertions(+), 71 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..7e888c4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,111 @@ +name: Main + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + + - name: Set up Javascript/Node + uses: actions/setup-node@v2 + with: + node-version: '12' + + - 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: '12' + + - 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 + + - name: Tests RPKI + run: | + rm -f -R .cache/ + ./node_modules/.bin/mocha --exit tests/rpki_tests/tests.default.js --require @babel/register + ./node_modules/.bin/mocha --exit tests/rpki_tests/tests.external.js --require @babel/register + rm -f -R .cache/ && ./node_modules/.bin/mocha --exit tests/rpki_tests/tests.external-roas.js --require @babel/register + + - name: Tests Proxy + run: | + npm install -g anyproxy + nohup anyproxy --port 8001 & + ANYPROXY_PID=$! + npm run test-proxy + kill $ANYPROXY_PID + + - name: Tests Kafka + run: | + sudo apt-get -y install tar + sudo apt-get -y install wget + wget https://mirror.lyrahosting.com/apache/kafka/2.6.0/kafka_2.13-2.6.0.tgz + tar -xzf kafka_2.13-2.6.0.tgz + nohup ./kafka_2.13-2.6.0/bin/zookeeper-server-start.sh ./kafka_2.13-2.6.0/config/zookeeper.properties & + nohup ./kafka_2.13-2.6.0/bin/kafka-server-start.sh ./kafka_2.13-2.6.0/config/server.properties & + nohup ./kafka_2.13-2.6.0/bin/kafka-topics.sh --create --topic bgpalerter --bootstrap-server 0.0.0.0:9092 & + npm run test-kafka + + - name: Upload Artifact + uses: actions/upload-artifact@v2 + if: ${{ always() }} + with: + name: logs + path: ~/.npm/_logs/* + retention-days: 14 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8e6391e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,45 +0,0 @@ -language: node_js -node_js: - - 12 - -jobs: - include: - - stage: "Tests" - name: "Tests without proxy" - script: - - npm run test-core - - npm run test-generate - - npm run test-reports - - name: "Tests rpki" - before_script: - - rm -f -R .cache/ - script: - - ./node_modules/.bin/mocha --exit tests/rpki_tests/tests.default.js --require @babel/register - - ./node_modules/.bin/mocha --exit tests/rpki_tests/tests.external.js --require @babel/register - - rm -f -R .cache/ && ./node_modules/.bin/mocha --exit tests/rpki_tests/tests.external-roas.js --require @babel/register - - name: "Tests with proxy" - before_script: - - npm install -g anyproxy - - nohup anyproxy --port 8001 & - - ANYPROXY_PID=$! - script: - - npm run test-proxy - after_script: - - kill $ANYPROXY_PID - - name: "Tests reportKafka" - before_script: - - sudo apt-get -y install tar - - sudo apt-get -y install wget - - wget https://mirror.lyrahosting.com/apache/kafka/2.6.0/kafka_2.13-2.6.0.tgz - - tar -xzf kafka_2.13-2.6.0.tgz - - nohup ./kafka_2.13-2.6.0/bin/zookeeper-server-start.sh ./kafka_2.13-2.6.0/config/zookeeper.properties & - - nohup ./kafka_2.13-2.6.0/bin/kafka-server-start.sh ./kafka_2.13-2.6.0/config/server.properties & - - nohup ./kafka_2.13-2.6.0/bin/kafka-topics.sh --create --topic bgpalerter --bootstrap-server 0.0.0.0:9092 & - script: - - npm run test-kafka - -cache: - npm: true - directories: - - node_modules - diff --git a/AUTHORS b/AUTHORS index f65c226..abb3d4f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,25 +1,26 @@ -BGPalerter was originally created at the beginning of 2019 at NTT Ltd. - -Here is a list of authors and contributors who patched or extended the code. -If this list is not up to date, please contact NTT or one of the authors. - -- AUTHORS - - - Massimo Candela - NTT - https://massimocandela.com/ - -- CONTRIBUTORS - - Damian Zaremba, Fastly - Mircea Ulinic, DigitalOcean - Alan Haynes, Harbin Clinic - Florian Domain, Criteo - - -A special THANK YOU goes to: - - Job Snijders for pushing for this project to happen. - - The RIPE RIS project for the amazing real-time streaming service. - - +BGPalerter was originally created at the beginning of 2019 at NTT Ltd. + +Here is a list of authors and contributors who patched or extended the code. +If this list is not up to date, please contact NTT or one of the authors. + +- AUTHORS - + + Massimo Candela + NTT + https://massimocandela.com/ + +- CONTRIBUTORS - + Damian Zaremba, Fastly + Mircea Ulinic, DigitalOcean + Alan Haynes, Harbin Clinic + Florian Domain, Criteo + Louis Poinsignon, Cloudflare + + +A special THANK YOU goes to: + + Job Snijders for pushing for this project to happen. + + The RIPE RIS project for the amazing real-time streaming service. + + diff --git a/README.md b/README.md index 65773cc..b5288f9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/nttgin/BGPalerter.svg?branch=master)](https://travis-ci.org/nttgin/BGPalerter) +[![Build Status](https://github.com/nttgin/BGPalerter/workflows/Main/badge.svg)](https://github.com/nttgin/BGPalerter/actions?query=workflow%3AMain) ![Dependabot Status](https://badgen.net/dependabot/nttgin/BGPalerter/?icon=dependabot) [![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)