Skip to content

Commit

Permalink
Added ci pipelines (#15)
Browse files Browse the repository at this point in the history
* Added ci pipelines

* Fix web test
  • Loading branch information
Odraxs authored Mar 12, 2024
1 parent 58315e1 commit 4ce79f4
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 3 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Project CI

on:
push:
branches:
- "main"
- "v*.[0-9]"
pull_request:

jobs:
web-ci:
name: Project CI
runs-on: ubuntu-latest

strategy:
matrix:
node-version: ["20.10.x"]
dir : ["web"]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup environment
run: mv .env.example .env
working-directory: ${{ matrix.dir }}

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
working-directory: ${{ matrix.dir }}

- name: Install Yarn
run: |
npm install -g yarn
npm i
working-directory: ${{ matrix.dir }}

- name: Run lint
run: yarn lint
working-directory: ${{ matrix.dir }}

- name: Run tests
run: yarn test:unit
working-directory: ${{ matrix.dir }}

server-ci:
name: Wev CI
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.22.x"]
dir: ["server", "data-embedding"]

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: WillAbides/setup-go-faster@v1.14.0
with:
go-version: ${{ matrix.go-version }}

- name: Run test
run: go test ./...
working-directory: ${{ matrix.dir }}

- name: Run vet
run: go vet ./...
working-directory: ${{ matrix.dir }}

# This action doesn't work with go-version > 1.19 😟
# - uses: dominikh/staticcheck-action@v1.3.0
# with:
# version: "2022.1.3"
# install-go: false
# cache-key: ${{ matrix.go-version }}
# working-directory: ${{ matrix.dir }}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { describe, it, expect } from 'vitest'

import { mount } from '@vue/test-utils'
import EmailsVisualizer from '../EmailsVisualizer.vue'
import Header from '../Header.vue'

describe('EmailsVisualizer', () => {
describe('Header', () => {
it('renders properly', () => {
const wrapper = mount(EmailsVisualizer, { props: { msg: 'Hello Vitest' } })
const wrapper = mount(Header, { props: { msg: 'Hello Vitest' } })
expect(wrapper.text()).toContain('Hello Vitest')
})
})

0 comments on commit 4ce79f4

Please sign in to comment.