Skip to content

Commit

Permalink
configure CI
Browse files Browse the repository at this point in the history
  • Loading branch information
juristr committed Sep 17, 2024
1 parent 844380b commit 5a55a36
Show file tree
Hide file tree
Showing 6 changed files with 163 additions and 11 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/__ci.backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

on:
push:
branches:
- main
pull_request:

permissions:
actions: read
contents: read

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: pnpm/action-setup@v4
with:
version: 9

# This enables task distribution via Nx Cloud
# Run this command as early as possible, before dependencies are installed
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
- run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build"

# Cache node_modules
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- run: pnpm install --frozen-lockfile
- uses: nrwl/nx-set-shas@v4

# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
# - run: pnpm exec nx-cloud record -- echo Hello World
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
- run: pnpm exec nx affected -t lint test build
7 changes: 3 additions & 4 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ jobs:
run: |
pnpm format:check
pnpm lint
pnpm --filter "@tasker/web" build
pnpm --filter "@tasker/*" test
- name: Run Playwright tests
run: pnpm --filter "@tasker/e2e-web" e2e
pnpm exec nx run-many -t test build e2e
# - name: Run Playwright tests
# run: pnpm --filter "@tasker/e2e-web" e2e
- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down
3 changes: 2 additions & 1 deletion e2e/web/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export default defineConfig({

webServer: {
timeout: 30_000,
command: 'pnpm --filter "@tasker/web" start',
// command: 'pnpm --filter "@tasker/web" start',
command: 'pnpm nx start @tasker/web',
url: 'http://localhost:3000',
reuseExistingServer: true,
},
Expand Down
18 changes: 14 additions & 4 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@
"outputs": ["{projectRoot}/.next"],
"cache": true
},
"e2e": { "cache": true },
"lint": { "cache": true },
"test": { "cache": true }
"e2e": {
"cache": true
},
"lint": {
"cache": true
},
"test": {
"cache": true
}
},
"defaultBase": "main",
"nxCloudId": "66e99dcf5d41efe7b0c5dc21"
"nxCloudId": "66e99dcf5d41efe7b0c5dc21",
"namedInputs": {
"sharedGlobals": ["{workspaceRoot}/.github/workflows/verify.yml"],
"default": ["sharedGlobals"]
}
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"typescript-eslint": "^7.9.0",
"vitest": "^1.6.0",
"@playwright/test": "^1.44.0",
"nx": "19.7.3"
"nx": "19.7.3",
"@nx/workspace": "19.7.3"
}
}
}
99 changes: 99 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5a55a36

Please sign in to comment.