Skip to content

Commit

Permalink
Add git action workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
CristyNel committed Aug 26, 2024
1 parent ec421aa commit 25cf1db
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#? CV_project/.github/workflows/integration-tests.yml
---
name: integration tests

# events workflow
on:
push:
paths:
- api/**
- .github/workflows/integration-tests.yml
branches:
- main
pull_request:
paths:
- api/**
- .github/workflows/integration-tests.yml
branches:
- main
workflow_dispatch: null

# jobs workflow
jobs:
integration-tests:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/c
- name: set up go
uses: actions/setup-
with:
go-version: 1.22.0
- name: install dependencies
run: go mod tidy
working-directory: ./api
- name: run integration tests
run: go test -v ./test
working-directory: ./a
- name: verify go installation
run: go version
- name: cache go modules
uses: actions/cac
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('api/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
48 changes: 48 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#? CV_project/.github/workflows/unit-tests.yml
---
name: unit tests

# events workflow
on:
push:
paths:
- api/**
- .github/workflows/unit_test.yml
branches:
- main
pull_request:
paths:
- api/**
- .github/workflows/unit_test.yml
branches:
- main
workflow_dispatch: null

# jobs workflow
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- name: set up go
uses: actions/setup-go@v5
with:
go-version: 1.22.0
- name: install dependencies
run: go mod tidy
working-directory: ./api
- name: run unit tests
run: go test -v ./...
working-directory: ./api
- name: verify go installation
run: go version
- name: cache go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('api/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
41 changes: 41 additions & 0 deletions .github/workflows/venom-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#? CV_project/.github/workflows/venom-tests.yml
---
name: venom tests

# events workflow
on:
push:
paths:
- api/**
- .github/workflows/venom-tests.yml
branches:
- main
- develop
pull_request:
paths:
- api/**
- .github/workflows/venom-tests.yml
branches:
- main
- develop
workflow_dispatch: null

# jobs workflow
jobs:
venom-tests:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- name: install docker compose
run: sudo apt-get install docker-compose
- name: start docker compose services
run: docker-compose up -d
- name: install venom
run: |
curl https://github.com/ovh/venom/releases/download/v1.0.1/venom.linux-amd64 -L -o /usr/local/bin/venom
chmod +x /usr/local/bin/venom
- name: run e2e tests
run: /usr/local/bin/venom run #TODO: add venom file path
- name: stop docker compose
run: docker-compose down

0 comments on commit 25cf1db

Please sign in to comment.