fasten-onprem/.github/workflows/ci.yaml

90 lines
2.4 KiB
YAML
Raw Normal View History

2022-09-26 19:42:33 -06:00
name: CI
# This workflow is triggered on pushes & pull requests
2022-10-14 09:58:22 -06:00
on:
pull_request:
branches:
- main
2023-05-12 15:35:34 -06:00
- sandbox
- beta
2022-10-14 09:58:22 -06:00
push:
branches: [ main, beta ]
# Publish semver tags as releases.
2023-07-16 13:55:29 -06:00
release:
types: [published]
2022-09-26 19:42:33 -06:00
jobs:
test-frontend:
name: Test Frontend
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
2022-10-14 10:22:29 -06:00
- name: test
2022-10-14 10:19:51 -06:00
uses: actions/setup-node@v1
with:
node-version: 20.x
2022-09-26 19:42:33 -06:00
- name: Test Frontend
run: |
make test-frontend-coverage
- name: Upload coverage
uses: actions/upload-artifact@v3
with:
name: coverage
path: ${{ github.workspace }}/frontend/coverage/fastenhealth/lcov.info
retention-days: 1
2022-09-26 19:42:33 -06:00
test-backend:
name: Test Backend
runs-on: ubuntu-latest
container: ghcr.io/packagrio/packagr:latest-golang
env:
STATIC: true
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Test Backend
run: |
go install github.com/golang/mock/mockgen@v1.6.0
go generate ./...
make test-backend-coverage
CGO_ENABLED=0 go build -buildvcs=false ./backend/cmd/fasten/
- name: Upload coverage
uses: actions/upload-artifact@v3
with:
name: coverage
path: ${{ github.workspace }}/backend-coverage.txt
retention-days: 1
test-coverage:
name: Test Coverage Upload
needs:
- test-backend
- test-frontend
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download coverage reports
uses: actions/download-artifact@v3
with:
name: coverage
- name: Upload coverage reports
uses: codecov/codecov-action@v2
with:
files: ${{ github.workspace }}/backend-coverage.txt,${{ github.workspace }}/lcov.info
flags: unittests
fail_ci_if_error: true
verbose: true
storybook:
name: Storybook Upload
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: cd frontend && yarn install
- uses: chromaui/action@v1
with:
workingDir: frontend
buildScriptName: "build-storybook"
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}