* chore: build pipeline for v2

* chore: run unit tests

* chore: configure sentry build
This commit is contained in:
Carlos Valente
2023-04-01 23:06:42 +02:00
committed by GitHub
parent 9338a615d4
commit 7456205b6e
27 changed files with 680 additions and 425 deletions
+1 -3
View File
@@ -2,9 +2,7 @@ name: Ontime build
on:
push:
# run when a tag is created
tags:
- '*'
tags: [ "v1.*.*" ]
workflow_dispatch:
jobs:
+3 -17
View File
@@ -20,50 +20,36 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v3.6.0
with:
# File containing the version Spec of the version to use. Examples: .nvmrc, .node-version, .tool-versions.
version: 16.16.0
- name: Setup pnpm
# You may pin to the exact commit or the version.
# uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd
uses: pnpm/action-setup@v2.2.4
with:
# Version of pnpm to install
version: 7.26.3
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build project packages
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: pnpm turbo build:docker
- name: Docker Login
# You may pin to the exact commit or the version.
# uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
uses: docker/login-action@v2.1.0
with:
# Username used to log against the Docker registry
username: ${{ secrets.DOCKERHUB_USERNAME }}
# Password or personal access token used to log against the Docker registry
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Setup Buildx
# You may pin to the exact commit or the version.
# uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c
uses: docker/setup-buildx-action@v2.5.0
- name: Build and push Docker images
# You may pin to the exact commit or the version.
# uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
uses: docker/build-push-action@v4.0.0
with:
# Build's context is the set of files located in the specified PATH or URL
context: .
# Path to the Dockerfile
file: ./Dockerfile
# List of target platforms for build
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
# Push is a shorthand for --output=type=registry
push: true
# List of tags
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ontime:beta_${{ env.RELEASE_VERSION }} , ${{ secrets.DOCKERHUB_USERNAME }}/ontime:beta_v2
+106
View File
@@ -0,0 +1,106 @@
name: Ontime build v2
on:
push:
tags: [ "v2.*.*" ]
workflow_dispatch:
jobs:
build_macos:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Setup pnpm
uses: pnpm/action-setup@v2.2.4
with:
version: 7.26.3
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build project packages
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: pnpm build
- name: Electron - Build app
run: pnpm dist-mac
- name: Release
uses: softprops/action-gh-release@v1
with:
files: './apps/electron/dist/ontime-macOS.dmg'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Setup pnpm
uses: pnpm/action-setup@v2.2.4
with:
version: 7.26.3
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build project packages
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: pnpm build
- name: Electron - Build app
run: pnpm dist-win
- name: Release
uses: softprops/action-gh-release@v1
with:
files: './apps/electron/dist/ontime-win64.exe'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Setup pnpm
uses: pnpm/action-setup@v2.2.4
with:
version: 7.26.3
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build project packages
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: pnpm build
- name: Electron - Build app
run: pnpm dist-linux
- name: Release
uses: softprops/action-gh-release@v1
with:
files: './apps/electron/dist/ontime-linux.AppImage'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+42
View File
@@ -0,0 +1,42 @@
name: Ontime test v2
on:
pull_request:
branches: [ v2 ]
workflow_dispatch:
jobs:
testing:
runs-on: ubuntu-latest
timeout-minutes: 20
env:
CI: ''
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Setup pnpm
uses: pnpm/action-setup@v2.2.4
with:
version: 7.26.3
- name: Install dependencies
run: pnpm install --frozen-lockfile
# We choose to run tests separately
- name: React - Run unit tests
run: pnpm test:pipeline
working-directory: ./apps/client
- name: Server - Run unit tests
run: pnpm test:pipeline
working-directory: ./apps/server
- name: Utils - Run unit tests
run: pnpm test:pipeline
working-directory: ./packages/utils