Upgrade to typescript@5.4.5 #100
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: master | |
env: | |
# CodeClimate only shows coverage for the default branch | |
# As this action is only triggered by tags, assume the branch is 'master' | |
GIT_BRANCH: master | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
jobs: | |
setup: | |
name: Setup test coverage reporting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download CodeClimate test reporter | |
run: | | |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter | |
chmod +x ./cc-test-reporter | |
- name: Notify CodeClimate of a pending report | |
run: ./cc-test-reporter before-build | |
frontend: | |
name: Test and lint frontend | |
needs: setup | |
runs-on: macos-14 | |
outputs: | |
workspace: ${{ github.workspace }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .tool-versions | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Lint and test | |
env: | |
DEVELOPER_DIR: /Applications/Xcode_15.3.app/Contents/Developer | |
run: npm test | |
- name: Upload test coverage artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: lcov.info | |
path: coverage/frontend/lcov.info | |
backend: | |
name: Lint and test backend | |
needs: setup | |
runs-on: ubuntu-latest | |
env: | |
TVMANAGER_COUCHDB_URL: http://${{ secrets.COUCHDB_USER }}:${{ secrets.COUCHDB_PASSWORD }}@localhost:5984/tvm | |
BUNDLE_WITHOUT: production | |
services: | |
couchdb: | |
image: couchdb:latest | |
env: | |
COUCHDB_USER: ${{ secrets.COUCHDB_USER }} | |
COUCHDB_PASSWORD: ${{ secrets.COUCHDB_PASSWORD }} | |
ports: | |
- 5984:5984 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install ruby and gem dependencies | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Setup database | |
run: bundle exec rake db:migrate | |
- name: Lint | |
run: bundle exec rubocop | |
- name: Test | |
run: bundle exec rake spec | |
- name: Upload test coverage artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage.json | |
path: coverage/backend/coverage.json | |
report: | |
name: Send coverage report to CodeClimate | |
needs: [frontend, backend] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download CodeClimate test reporter | |
run: | | |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter | |
chmod +x ./cc-test-reporter | |
- name: Download frontend test coverage artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: lcov.info | |
path: coverage/frontend | |
- name: Download backend test coverage artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: coverage.json | |
path: coverage/backend | |
- name: Format backend coverage | |
run: ./cc-test-reporter format-coverage --input-type simplecov --output coverage/codeclimate.backend.json coverage/backend/coverage.json | |
- name: Format frontend coverage | |
run: ./cc-test-reporter format-coverage --input-type lcov --output coverage/codeclimate.frontend.json --prefix ${{ needs.frontend.outputs.workspace }} coverage/frontend/lcov.info | |
- name: Merge backend and frontend coverage | |
run: ./cc-test-reporter sum-coverage --parts 2 coverage/codeclimate.*.json | |
- name: Upload coverage report | |
run: ./cc-test-reporter upload-coverage |