|
| 1 | +name: Workspace CI |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - dev |
| 7 | + - staging |
| 8 | + - main |
| 9 | + push: |
| 10 | + branches: |
| 11 | + - dev |
| 12 | + - staging |
| 13 | + - main |
| 14 | + |
| 15 | +jobs: |
| 16 | + workspace-build: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + permissions: |
| 19 | + contents: read |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: Cache Yarn dependencies |
| 24 | + uses: ./.github/actions/cache-yarn |
| 25 | + with: |
| 26 | + path: | |
| 27 | + .yarn/cache |
| 28 | + node_modules |
| 29 | + */node_modules |
| 30 | + packages/*/node_modules |
| 31 | + cache-version: v1 |
| 32 | + |
| 33 | + - name: Install Dependencies |
| 34 | + uses: ./.github/actions/yarn-install |
| 35 | + |
| 36 | + - name: Run workspace build |
| 37 | + run: yarn build |
| 38 | + |
| 39 | + - name: Verify build artifacts |
| 40 | + run: | |
| 41 | + echo "Checking for build artifacts..." |
| 42 | + find . -name "dist" -type d | head -10 |
| 43 | + echo "Build completed successfully!" |
| 44 | +
|
| 45 | + workspace-type-check: |
| 46 | + runs-on: ubuntu-latest |
| 47 | + permissions: |
| 48 | + contents: read |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v4 |
| 51 | + |
| 52 | + - name: Cache Yarn dependencies |
| 53 | + uses: ./.github/actions/cache-yarn |
| 54 | + with: |
| 55 | + path: | |
| 56 | + .yarn/cache |
| 57 | + node_modules |
| 58 | + */node_modules |
| 59 | + packages/*/node_modules |
| 60 | + cache-version: v1 |
| 61 | + |
| 62 | + - name: Install Dependencies |
| 63 | + uses: ./.github/actions/yarn-install |
| 64 | + |
| 65 | + - name: Run workspace type checking |
| 66 | + run: yarn types |
| 67 | + |
| 68 | + - name: Verify type checking passed |
| 69 | + run: echo "Type checking completed successfully!" |
| 70 | + |
| 71 | + workspace-lint: |
| 72 | + runs-on: ubuntu-latest |
| 73 | + permissions: |
| 74 | + contents: read |
| 75 | + steps: |
| 76 | + - uses: actions/checkout@v4 |
| 77 | + |
| 78 | + - name: Cache Yarn dependencies |
| 79 | + uses: ./.github/actions/cache-yarn |
| 80 | + with: |
| 81 | + path: | |
| 82 | + .yarn/cache |
| 83 | + node_modules |
| 84 | + */node_modules |
| 85 | + packages/*/node_modules |
| 86 | + cache-version: v1 |
| 87 | + |
| 88 | + - name: Install Dependencies |
| 89 | + uses: ./.github/actions/yarn-install |
| 90 | + |
| 91 | + - name: Run workspace linting |
| 92 | + run: yarn lint |
| 93 | + |
| 94 | + - name: Verify linting passed |
| 95 | + run: echo "Linting completed successfully!" |
| 96 | + |
| 97 | + workspace-format-check: |
| 98 | + runs-on: ubuntu-latest |
| 99 | + permissions: |
| 100 | + contents: read |
| 101 | + steps: |
| 102 | + - uses: actions/checkout@v4 |
| 103 | + |
| 104 | + - name: Cache Yarn dependencies |
| 105 | + uses: ./.github/actions/cache-yarn |
| 106 | + with: |
| 107 | + path: | |
| 108 | + .yarn/cache |
| 109 | + node_modules |
| 110 | + */node_modules |
| 111 | + packages/*/node_modules |
| 112 | + cache-version: v1 |
| 113 | + |
| 114 | + - name: Install Dependencies |
| 115 | + uses: ./.github/actions/yarn-install |
| 116 | + |
| 117 | + - name: Check code formatting (dry run) |
| 118 | + run: | |
| 119 | + echo "Checking if code is properly formatted..." |
| 120 | + # Run format in dry-run mode by checking if any files would change |
| 121 | + if ! git diff --quiet --exit-code; then |
| 122 | + echo "Working directory not clean before format check" |
| 123 | + git status --porcelain |
| 124 | + exit 1 |
| 125 | + fi |
| 126 | + yarn format |
| 127 | + if ! git diff --quiet --exit-code; then |
| 128 | + echo "❌ Code formatting issues found. The following files need formatting:" |
| 129 | + git diff --name-only |
| 130 | + echo "Run 'yarn format' to fix these issues." |
| 131 | + exit 1 |
| 132 | + fi |
| 133 | +
|
| 134 | + - name: Verify formatting check passed |
| 135 | + run: echo "Code formatting check completed successfully!" |
| 136 | + |
| 137 | + workspace-test: |
| 138 | + runs-on: ubuntu-latest |
| 139 | + permissions: |
| 140 | + contents: read |
| 141 | + steps: |
| 142 | + - uses: actions/checkout@v4 |
| 143 | + |
| 144 | + - name: Cache Yarn dependencies |
| 145 | + uses: ./.github/actions/cache-yarn |
| 146 | + with: |
| 147 | + path: | |
| 148 | + .yarn/cache |
| 149 | + node_modules |
| 150 | + */node_modules |
| 151 | + packages/*/node_modules |
| 152 | + cache-version: v1 |
| 153 | + |
| 154 | + - name: Install Dependencies |
| 155 | + uses: ./.github/actions/yarn-install |
| 156 | + |
| 157 | + - name: Run workspace tests |
| 158 | + run: yarn test |
| 159 | + |
| 160 | + - name: Verify tests passed |
| 161 | + run: echo "Workspace tests completed successfully!" |
| 162 | + |
| 163 | + version-consistency: |
| 164 | + runs-on: ubuntu-latest |
| 165 | + permissions: |
| 166 | + contents: read |
| 167 | + steps: |
| 168 | + - uses: actions/checkout@v4 |
| 169 | + |
| 170 | + - name: Cache Yarn dependencies |
| 171 | + uses: ./.github/actions/cache-yarn |
| 172 | + with: |
| 173 | + path: | |
| 174 | + .yarn/cache |
| 175 | + node_modules |
| 176 | + */node_modules |
| 177 | + packages/*/node_modules |
| 178 | + cache-version: v1 |
| 179 | + |
| 180 | + - name: Install Dependencies |
| 181 | + uses: ./.github/actions/yarn-install |
| 182 | + |
| 183 | + - name: Check package version consistency |
| 184 | + run: yarn check:versions |
| 185 | + |
| 186 | + - name: Verify version consistency |
| 187 | + run: echo "Package version consistency check passed!" |
0 commit comments