From 881dbc88de4fdcb6a7fd93d00c9a0845bde87c32 Mon Sep 17 00:00:00 2001 From: Devin Matte Date: Wed, 23 Dec 2020 14:51:04 -0500 Subject: [PATCH 1/2] Create python-app.yml --- .github/workflows/python-app.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/python-app.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 00000000..ef0e15f1 --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,31 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python application + +on: + push: + branches: [ master, develop ] + pull_request: + branches: [ master, develop ] + +jobs: + lint: + + runs-on: ubuntu-latest + + steps: + - name: Install ldap dependencies + run: sudo apt-get install libldap2-dev libsasl2-dev + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with pylint + run: | + pylint packet From e4cba1ccd95a8b48b1bc2010bd3d688ce1171aab Mon Sep 17 00:00:00 2001 From: Devin Matte Date: Wed, 23 Dec 2020 14:55:51 -0500 Subject: [PATCH 2/2] Creating node and docker ci --- .github/workflows/docker-build.yml | 32 ++++++++++++++++++++++++++ .github/workflows/node-js.yml | 27 ++++++++++++++++++++++ .github/workflows/python-app.yml | 37 ++++++++++++++++-------------- .travis.yml | 16 ------------- Dockerfile | 2 +- package.json | 4 ++++ 6 files changed, 84 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/docker-build.yml create mode 100644 .github/workflows/node-js.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 00000000..d9295202 --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,32 @@ +name: Docker + +on: + push: + branches: + - develop + - master + + # Run tests for any PRs. + pull_request: + branches: + - develop + - master + +env: + IMAGE_NAME: packet + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Run tests + run: | + if [ -f docker-compose.test.yml ]; then + docker-compose --file docker-compose.test.yml build + docker-compose --file docker-compose.test.yml run sut + else + docker build . --file Dockerfile + fi diff --git a/.github/workflows/node-js.yml b/.github/workflows/node-js.yml new file mode 100644 index 00000000..c2f0af6f --- /dev/null +++ b/.github/workflows/node-js.yml @@ -0,0 +1,27 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: [develop, master] + pull_request: + branches: [develop, master] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x, 12.x, 14.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: yarn install + - run: yarn prod diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index ef0e15f1..71dcdd5c 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -5,27 +5,30 @@ name: Python application on: push: - branches: [ master, develop ] + branches: [master, develop] pull_request: - branches: [ master, develop ] + branches: [master, develop] jobs: lint: - runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.7, 3.8] + steps: - - name: Install ldap dependencies - run: sudo apt-get install libldap2-dev libsasl2-dev - - uses: actions/checkout@v2 - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Lint with pylint - run: | - pylint packet + - name: Install ldap dependencies + run: sudo apt-get install libldap2-dev libsasl2-dev + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with pylint + run: | + pylint packet diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d0cbb081..00000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: python -python: - - "3.7" -services: - - "docker" - -install: - - "pip install -r requirements.txt" - - "curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.3/install.sh | bash" - - "nvm install" - - "nvm use" - - "npm install -g gulp" - - "npm install" -script: - - "gulp lint" - - "docker build -t packet ." diff --git a/Dockerfile b/Dockerfile index 594379e9..98ca1d5e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM python:3.7-slim-buster MAINTAINER Devin Matte RUN apt-get -yq update && \ - apt-get -yq --no-install-recommends install gcc curl libsasl2-dev libldap2-dev libssl-dev && \ + apt-get -yq --no-install-recommends install gcc curl libsasl2-dev libldap2-dev libssl-dev gnupg2 && \ apt-get -yq clean all RUN mkdir /opt/packet diff --git a/package.json b/package.json index b97168dd..fda35954 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,10 @@ "Joel Eager (https://github.com/JoelEager)", "Max Meinhold (https://github.com/mxmeinhold)" ], + "scripts": { + "prod": "gulp production", + "lint": "gulp lint" + }, "repository": { "type": "git", "url": "https://github.com/ComputerScienceHouse/packet.git"