diff --git a/.github/workflows/build_v3.yml b/.github/workflows/build_v3.yml new file mode 100644 index 000000000..909bf8468 --- /dev/null +++ b/.github/workflows/build_v3.yml @@ -0,0 +1,109 @@ +name: Ontime build v3 + +on: +# Only trigger manually for now for testing +# push: +# tags: [ "*" ] + workflow_dispatch: + +jobs: + build_macos: + runs-on: macOS-latest + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: 18.18.2 + + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + version: 8 + + - 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-x64.dmg + ./apps/electron/dist/ontime-macOS-arm64.dmg + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + build_windows: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: 18.18.2 + + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + version: 8 + + - 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@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: 18.18.2 + + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + version: 8 + + - 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 }} diff --git a/.github/workflows/test_v3.yml b/.github/workflows/test_v3.yml new file mode 100644 index 000000000..36f339f7e --- /dev/null +++ b/.github/workflows/test_v3.yml @@ -0,0 +1,107 @@ +name: Ontime test v3 + +on: +# Only trigger manually for now for testing +# pull_request: +# branches: '*' + workflow_dispatch: + +jobs: + unit-test: + runs-on: ubuntu-latest + timeout-minutes: 20 + env: + CI: '' + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: 18.18.2 + + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + version: 8 + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + # Run code quality per package + - name: React - Run linter + TypeScript checks + if: always() + run: pnpm lint && tsc --noEmit + working-directory: ./apps/client + + - name: Server - Run linter + TypeScript checks + if: always() + run: pnpm lint && tsc --noEmit + working-directory: ./apps/server + + - name: Utils - Run linter + TypeScript checks + if: always() + run: pnpm lint && tsc --noEmit + working-directory: ./packages/utils + + - name: Types - Run linter + if: always() + run: pnpm lint + working-directory: ./packages/types + + # We choose to run tests separately + - name: React - Run unit tests + if: always() + run: pnpm test:pipeline + working-directory: ./apps/client + + - name: Server - Run unit tests + if: always() + run: pnpm test:pipeline + working-directory: ./apps/server + + - name: Utils - Run unit tests + if: always() + run: pnpm test:pipeline + working-directory: ./packages/utils + + e2e-test: + runs-on: ubuntu-latest + timeout-minutes: 20 + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: 18.18.2 + + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + version: 8 + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build client + run: pnpm build:local + + - name: Install Playwright Browsers + run: npx playwright install --with-deps + + - name: Run Playwright tests + run: pnpm e2e + + - uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 + + - uses: actions/upload-artifact@v4 + with: + name: automated-screenshots + path: automated-screenshots/ + retention-days: 14