|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + pull_request: |
| 6 | + types: [opened, edited, synchronize] |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +jobs: |
| 10 | + format: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + permissions: |
| 13 | + contents: read |
| 14 | + steps: |
| 15 | + - name: Checkout |
| 16 | + uses: actions/checkout@v4 |
| 17 | + with: |
| 18 | + fetch-depth: 0 |
| 19 | + |
| 20 | + - name: Build hermetic image |
| 21 | + run: docker build -f Dockerfile.repro -t lingo-repro:20.12.2 . |
| 22 | + |
| 23 | + - name: Prepare pnpm store path |
| 24 | + run: echo "REPRO_PNPM_STORE=${{ runner.temp }}/pnpm-store" >> $GITHUB_ENV |
| 25 | + |
| 26 | + - name: Cache pnpm store |
| 27 | + uses: actions/cache@v3 |
| 28 | + with: |
| 29 | + path: ${{ env.REPRO_PNPM_STORE }} |
| 30 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 31 | + restore-keys: | |
| 32 | + ${{ runner.os }}-pnpm-store- |
| 33 | +
|
| 34 | + - name: Install deps (container) |
| 35 | + run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm install --frozen-lockfile |
| 36 | + |
| 37 | + - name: Check formatting (container) |
| 38 | + run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm prettier . --check |
| 39 | + |
| 40 | + typecheck: |
| 41 | + runs-on: ubuntu-latest |
| 42 | + permissions: |
| 43 | + contents: read |
| 44 | + steps: |
| 45 | + - name: Checkout |
| 46 | + uses: actions/checkout@v4 |
| 47 | + with: |
| 48 | + fetch-depth: 0 |
| 49 | + |
| 50 | + - name: Build hermetic image |
| 51 | + run: docker build -f Dockerfile.repro -t lingo-repro:20.12.2 . |
| 52 | + |
| 53 | + - name: Prepare pnpm store path |
| 54 | + run: echo "REPRO_PNPM_STORE=${{ runner.temp }}/pnpm-store" >> $GITHUB_ENV |
| 55 | + |
| 56 | + - name: Cache pnpm store |
| 57 | + uses: actions/cache@v3 |
| 58 | + with: |
| 59 | + path: ${{ env.REPRO_PNPM_STORE }} |
| 60 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 61 | + restore-keys: | |
| 62 | + ${{ runner.os }}-pnpm-store- |
| 63 | +
|
| 64 | + - name: Install deps (container) |
| 65 | + run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm install --frozen-lockfile |
| 66 | + |
| 67 | + - name: Typecheck (container) |
| 68 | + run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm turbo typecheck |
| 69 | + |
| 70 | + build: |
| 71 | + runs-on: ubuntu-latest |
| 72 | + permissions: |
| 73 | + contents: read |
| 74 | + steps: |
| 75 | + - name: Checkout |
| 76 | + uses: actions/checkout@v4 |
| 77 | + with: |
| 78 | + fetch-depth: 0 |
| 79 | + |
| 80 | + - name: Build hermetic image |
| 81 | + run: docker build -f Dockerfile.repro -t lingo-repro:20.12.2 . |
| 82 | + |
| 83 | + - name: Prepare pnpm store path |
| 84 | + run: echo "REPRO_PNPM_STORE=${{ runner.temp }}/pnpm-store" >> $GITHUB_ENV |
| 85 | + |
| 86 | + - name: Cache pnpm store |
| 87 | + uses: actions/cache@v3 |
| 88 | + with: |
| 89 | + path: ${{ env.REPRO_PNPM_STORE }} |
| 90 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 91 | + restore-keys: | |
| 92 | + ${{ runner.os }}-pnpm-store- |
| 93 | +
|
| 94 | + - name: Install deps (container) |
| 95 | + run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm install --frozen-lockfile |
| 96 | + |
| 97 | + - name: Build (container) |
| 98 | + run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm turbo build --force |
| 99 | + |
| 100 | + test: |
| 101 | + runs-on: ubuntu-latest |
| 102 | + permissions: |
| 103 | + contents: read |
| 104 | + steps: |
| 105 | + - name: Checkout |
| 106 | + uses: actions/checkout@v4 |
| 107 | + with: |
| 108 | + fetch-depth: 0 |
| 109 | + |
| 110 | + - name: Build hermetic image |
| 111 | + run: docker build -f Dockerfile.repro -t lingo-repro:20.12.2 . |
| 112 | + |
| 113 | + - name: Prepare pnpm store path |
| 114 | + run: echo "REPRO_PNPM_STORE=${{ runner.temp }}/pnpm-store" >> $GITHUB_ENV |
| 115 | + |
| 116 | + - name: Cache pnpm store |
| 117 | + uses: actions/cache@v3 |
| 118 | + with: |
| 119 | + path: ${{ env.REPRO_PNPM_STORE }} |
| 120 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 121 | + restore-keys: | |
| 122 | + ${{ runner.os }}-pnpm-store- |
| 123 | +
|
| 124 | + - name: Install deps (container) |
| 125 | + run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm install --frozen-lockfile |
| 126 | + |
| 127 | + - name: Test (container) |
| 128 | + run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm turbo test |
| 129 | + |
| 130 | + changeset: |
| 131 | + runs-on: ubuntu-latest |
| 132 | + permissions: |
| 133 | + contents: read |
| 134 | + steps: |
| 135 | + - name: Checkout |
| 136 | + uses: actions/checkout@v4 |
| 137 | + with: |
| 138 | + fetch-depth: 0 |
| 139 | + |
| 140 | + - name: Build hermetic image |
| 141 | + run: docker build -f Dockerfile.repro -t lingo-repro:20.12.2 . |
| 142 | + |
| 143 | + - name: Prepare pnpm store path |
| 144 | + run: echo "REPRO_PNPM_STORE=${{ runner.temp }}/pnpm-store" >> $GITHUB_ENV |
| 145 | + |
| 146 | + - name: Cache pnpm store |
| 147 | + uses: actions/cache@v3 |
| 148 | + with: |
| 149 | + path: ${{ env.REPRO_PNPM_STORE }} |
| 150 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 151 | + restore-keys: | |
| 152 | + ${{ runner.os }}-pnpm-store- |
| 153 | +
|
| 154 | + - name: Mark repo as safe for git inside container |
| 155 | + run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh git config --global --add safe.directory /workspace |
| 156 | + |
| 157 | + - name: Install deps (container) |
| 158 | + run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm install --frozen-lockfile |
| 159 | + |
| 160 | + - name: Require changeset to be present in PR (container) |
| 161 | + if: github.event.pull_request.user.login != 'dependabot[bot]' |
| 162 | + run: REPRO_PNPM_STORE="${{ env.REPRO_PNPM_STORE }}" bash scripts/repro/exec.sh pnpm changeset status --since origin/main |
0 commit comments