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 new file mode 100644 index 00000000..71dcdd5c --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,34 @@ +# 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 + + 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 ${{ 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"