Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Projects API #684

Merged
merged 5 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 50 additions & 50 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
name: Build and run all tests
on:
push:
branches:
- main
pull_request:
push:
branches:
- main
pull_request:

jobs:
test:
if: ${{ !(contains(github.head_ref, 'ui/')) || !(contains(github.head_ref, 'cms/')) }}
strategy:
matrix:
go-version: [1.16.x, 1.17.x]
os: [ubuntu-latest, macos-latest]
mongodb-version: ["4.0", "4.2", "4.4"]
redis-version: ["6.2.6"]
test:
if: ${{ !(contains(github.head_ref, 'ui/')) || !(contains(github.head_ref, 'cms/')) }}
strategy:
matrix:
go-version: [1.16.x, 1.17.x]
os: [ubuntu-latest, macos-latest]
mongodb-version: ["4.0", "4.2", "4.4"]
redis-version: ["6.2.6"]

runs-on: ubuntu-latest
steps:
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.4.1
with:
mongodb-version: ${{ matrix.mongodb-version }}
runs-on: ubuntu-latest
steps:
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.4.1
with:
mongodb-version: ${{ matrix.mongodb-version }}

- name: Start Redis v${{ matrix.redis-version }}
uses: supercharge/redis-github-action@1.4.0
with:
redis-version: ${{ matrix.redis-version }}
redis-port: 6379
- name: Start Redis v${{ matrix.redis-version }}
uses: supercharge/redis-github-action@1.4.0
with:
redis-version: ${{ matrix.redis-version }}
redis-port: 6379

- name: Get the version
id: get_version
run: echo ::set-output name=tag::$(echo ${GITHUB_SHA:8})
- name: Get the version
id: get_version
run: echo ::set-output name=tag::$(echo ${GITHUB_SHA:8})

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Cache go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
- name: Cache go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}

- name: Check out code
uses: actions/checkout@v2
- name: Check out code
uses: actions/checkout@v2

- name: Get and verify dependencies
run: go mod download && go mod verify
- name: Get and verify dependencies
run: go mod download && go mod verify

- name: Build app to make sure there are zero issues
run: go build -o hookcamp ./cmd
- name: Build app to make sure there are zero issues
run: go build -o hookcamp ./cmd

- name: Go vet
run: go vet ./...
- name: Go vet
run: go vet ./...

- name: Run integration tests
run: go test -tags integration -v ./...
env:
TEST_BADGER_DSN: "../../test.db"
TEST_MONGO_DSN: "mongodb://localhost:27017/testdb"
TEST_REDIS_DSN: "redis://localhost:6379"
- name: Run integration tests
run: make integration_tests
env:
TEST_BADGER_DSN: "../../test.db"
TEST_MONGO_DSN: "mongodb://localhost:27017/testdb"
TEST_REDIS_DSN: "redis://localhost:6379"
148 changes: 71 additions & 77 deletions .github/workflows/immune-test.yml
Original file line number Diff line number Diff line change
@@ -1,89 +1,83 @@
name: Build and run immune tests
on:
push:
branches:
- main
pull_request:
push:
branches:
- main
pull_request:

jobs:
test:
if: ${{ !(contains(github.head_ref, 'ui/')) || !(contains(github.head_ref, 'cms/')) }}
strategy:
matrix:
go-version: [1.16.x, 1.17.x]
immune-test-file-names:
[
"test-push-events.json",
"test-groups.json",
"test-apps.json",
"test-app-endpoints.json",
]
immune-version: ["0.2.1"]
mongodb-version: ["4.0", "4.2", "4.4"]
redis-version: ["6.2.6"]
test:
if: ${{ !(contains(github.head_ref, 'ui/')) || !(contains(github.head_ref, 'cms/')) }}
strategy:
matrix:
go-version: [1.16.x, 1.17.x]
immune-test-file-names: []
immune-version: ["0.2.1"]
mongodb-version: ["4.0", "4.2", "4.4"]
redis-version: ["6.2.6"]

runs-on: ubuntu-latest
steps:
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.4.1
with:
mongodb-version: ${{ matrix.mongodb-version }}
runs-on: ubuntu-latest
steps:
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.4.1
with:
mongodb-version: ${{ matrix.mongodb-version }}

- name: Start Redis v${{ matrix.redis-version }}
uses: supercharge/redis-github-action@1.4.0
with:
redis-version: ${{ matrix.redis-version }}
redis-port: 6379
- name: Start Redis v${{ matrix.redis-version }}
uses: supercharge/redis-github-action@1.4.0
with:
redis-version: ${{ matrix.redis-version }}
redis-port: 6379

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Check out code
uses: actions/checkout@v2
- name: Check out code
uses: actions/checkout@v2

- name: Pull immune
run: |
wget --output-document=./immune.tar.gz \
https://github.com/frain-dev/immune/releases/download/v${{ matrix.immune-version }}/immune_${{ matrix.immune-version }}_linux_amd64.tar.gz
tar -xvzf ./immune.tar.gz
mv ./immune $(go env GOPATH)/bin/immune
- name: Pull immune
run: |
wget --output-document=./immune.tar.gz \
https://github.com/frain-dev/immune/releases/download/v${{ matrix.immune-version }}/immune_${{ matrix.immune-version }}_linux_amd64.tar.gz
tar -xvzf ./immune.tar.gz
mv ./immune $(go env GOPATH)/bin/immune

- name: Setup custom host for endpoint
run: echo "127.0.0.1 www.endpoint.url" | sudo tee -a /etc/hosts
- name: Setup custom host for endpoint
run: echo "127.0.0.1 www.endpoint.url" | sudo tee -a /etc/hosts

- name: Pull certgen
uses: danvixent/certgen-action@v0.1.6
with:
output-folder: $(go env GOPATH)/bin
os: ${{ runner.os }}
certgen-version: 0.2.0
- name: Pull certgen
uses: danvixent/certgen-action@v0.1.6
with:
output-folder: $(go env GOPATH)/bin
os: ${{ runner.os }}
certgen-version: 0.2.0

- name: Start convoy & run immune tests
env:
PORT: 5005
CONVOY_RETRY_LIMIT: "3"
CONVOY_INTERVAL_SECONDS: "10"
CONVOY_SIGNATURE_HEADER: "X-Convoy-CI"
CONVOY_STRATEGY_TYPE: "default"
CONVOY_SIGNATURE_HASH: "SHA256"
CONVOY_DB_TYPE: "mongodb"
CONVOY_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
CONVOY_DB_DSN: "mongodb://localhost:27017/testdb"
CONVOY_REDIS_DSN: "redis://localhost:6379"
CONVOY_QUEUE_PROVIDER: "redis"
IMMUNE_EVENT_TARGET_URL: https://www.endpoint.url:9098
IMMUNE_SSL: true
run: |
ref=$(certgen -domains="www.endpoint.url,endpoint.url")
echo "$ref"
go run ./cmd server &
IFS=', ' read -ra array <<< "$ref"
echo "${array[0]}"
echo "${array[1]}"
export IMMUNE_SSL_CERT_FILE="${array[0]}"
export IMMUNE_SSL_KEY_FILE="${array[1]}"
sleep 70
cd ./immune-test-files
immune run --config ./${{ matrix.immune-test-file-names }}
- name: Start convoy & run immune tests
env:
PORT: 5005
CONVOY_RETRY_LIMIT: "3"
CONVOY_INTERVAL_SECONDS: "10"
CONVOY_SIGNATURE_HEADER: "X-Convoy-CI"
CONVOY_STRATEGY_TYPE: "default"
CONVOY_SIGNATURE_HASH: "SHA256"
CONVOY_DB_TYPE: "mongodb"
CONVOY_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
CONVOY_DB_DSN: "mongodb://localhost:27017/testdb"
CONVOY_REDIS_DSN: "redis://localhost:6379"
CONVOY_QUEUE_PROVIDER: "redis"
IMMUNE_EVENT_TARGET_URL: https://www.endpoint.url:9098
IMMUNE_SSL: true
run: |
ref=$(certgen -domains="www.endpoint.url,endpoint.url")
echo "$ref"
go run ./cmd server &
IFS=', ' read -ra array <<< "$ref"
echo "${array[0]}"
echo "${array[1]}"
export IMMUNE_SSL_CERT_FILE="${array[0]}"
export IMMUNE_SSL_KEY_FILE="${array[1]}"
sleep 70
cd ./immune-test-files
immune run --config ./${{ matrix.immune-test-file-names }}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ ui_install:
npm run build

integration_tests:
go test -tags integration ./...
go test -tags integration -p 1 ./...

Loading