Add files via upload #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
- feature/* | |
- release/* | |
- hotfix/* | |
tags-ignore: | |
- 1.* | |
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@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
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@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
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@v3 | |
- 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 |