From 0435a019826e8ef605a0165f3f50013a9890c2df Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Tue, 26 Mar 2024 13:07:22 +0100 Subject: [PATCH] ci(shared): enable github actions --- .github/workflows/ci.yml | 50 ++++++++++++++++++++++++++++++++++++++++ package.json | 4 +++- turbo.json | 11 +++++---- 3 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..c956b073 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: CI + +on: + push: + branches: ["main"] + pull_request: + types: [opened, synchronize] + +jobs: + build: + name: Build and Test + timeout-minutes: 15 + runs-on: ubuntu-latest + env: + TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} + TURBO_TEAM: ${{ vars.TURBO_TEAM }} + + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - uses: pnpm/action-setup@v3 + with: + version: 8 + + - name: Setup Node.js environment + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install + + - name: Build cli + run: pnpm build --filter=cli + + - name: Install cli binary + run: pnpm install + + - name: Build + run: pnpm build + + - name: Install Playwright Browsers + run: pnpx playwright install --with-deps + + - name: Test + run: pnpm test diff --git a/package.json b/package.json index ee11d527..b80177e7 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,9 @@ "author": "Sebastian Sdorra ", "license": "MIT", "scripts": { - "commitlint": "commitlint --edit" + "commitlint": "commitlint --edit", + "build": "turbo build", + "test": "turbo test" }, "devDependencies": { "@changesets/changelog-github": "^0.5.0", diff --git a/turbo.json b/turbo.json index 6b0a2952..7bcc571e 100644 --- a/turbo.json +++ b/turbo.json @@ -5,14 +5,17 @@ "dependsOn": ["^build"], "outputs": ["dist/**", ".content-collections/**"] }, - "typecheck": { - "dependsOn": ["^build"] - }, "lint": { "dependsOn": ["^build"] }, "test": { - "dependsOn": ["build", "typecheck", "lint"] + "dependsOn": ["^build"] + }, + "typecheck": { + "dependsOn": ["^build", "^test"] + }, + "check": { + "dependsOn": ["^test", "^lint"] }, "dev": { "dependsOn": ["^build"],