diff --git a/.github/workflows/test-ci.yml b/.github/workflows/test-ci.yml new file mode 100644 index 0000000..5b01996 --- /dev/null +++ b/.github/workflows/test-ci.yml @@ -0,0 +1,63 @@ +name: Test CI + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +jobs: + backend-test: + name: Go Test Matrix + runs-on: ubuntu-latest + strategy: + matrix: + go-version: ['1.21', '1.22', '1.23'] + steps: + - uses: actions/checkout@v4 + + - name: Set up Go ${{ matrix.go-version }} + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go-version }} + + - name: Download dependencies + working-directory: server + run: go mod download + + - name: Build + working-directory: server + run: go build ./... + + - name: Test + working-directory: server + run: go test ./... -v -race + + frontend-test: + name: Node Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: web/package-lock.json + + - name: Install dependencies + working-directory: web + run: npm ci + + - name: Type Check + working-directory: web + run: npx tsc --noEmit -p tsconfig.json + + - name: Test + working-directory: web + run: npm run test -- --coverage + + - name: Build + working-directory: web + run: npm run build \ No newline at end of file