diff options
author | Emiliano Ciavatta | 2021-07-28 18:12:14 +0000 |
---|---|---|
committer | Emiliano Ciavatta | 2021-07-28 18:12:14 +0000 |
commit | 99cfe84c23f3beb8baf76b799ace1b3ffbf1d5ff (patch) | |
tree | 41d8bbbe2f46051aeebf5b4ae73c46325c4bf7c6 /.github/workflows/test.yml | |
parent | fdb0bf97d2dec72adf08e5f2d7ad65b560d8cf8e (diff) | |
parent | f60d7cb1da70d439cd401e2fa4b7ecccec41bfe4 (diff) |
Merge branch 'release/1.21.0' into main
Diffstat (limited to '.github/workflows/test.yml')
-rw-r--r-- | .github/workflows/test.yml | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..95b44fc --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,58 @@ +name: Test +on: [push, pull_request] +jobs: + test_backend: + name: Build and test backend + runs-on: ubuntu-latest + services: + mongo: + image: mongo:4.4 + ports: + - 27017:27017 + steps: + - uses: actions/checkout@v2 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.16 + - name: Install dependencies + run: sudo apt-get install pkg-config libpcap-dev libhyperscan-dev + - name: Test backend + run: go test -v -race -coverprofile=coverage.txt -covermode=atomic + - name: Upload coverage + run: bash <(curl -s https://codecov.io/bash) + build_frontend: + name: Build frontend + runs-on: ubuntu-latest + defaults: + run: + working-directory: frontend + steps: + - uses: actions/checkout@v2 + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: 14.x + - name: Install dependencies + run: yarn install + - name: Build frontend + run: yarn build + test_docker: + name: Build and test docker environment + runs-on: ubuntu-latest + env: + COMPOSE_FILE: .github/docker/docker-compose.yml + steps: + - uses: actions/checkout@v2 + - name: Pull docker images + run: docker-compose pull mongo + - name: Build docker backend + run: docker-compose build test-backend + - name: Build docker frontend + run: docker-compose build test-frontend + - name: Start MongoDB + run: docker-compose up -d mongo + - name: Test docker backend + run: docker-compose run test-backend + - name: Destroy containers + run: docker-compose down |