|
12 | 12 | CARGO_TERM_COLOR: always |
13 | 13 |
|
14 | 14 | jobs: |
15 | | - build-and-test: |
| 15 | + lib-build-and-test: |
16 | 16 | name: Build & Test |
17 | 17 | runs-on: ${{ matrix.os }} |
18 | 18 | timeout-minutes: 30 |
@@ -56,10 +56,64 @@ jobs: |
56 | 56 | run: cargo build --verbose |
57 | 57 | - name: Run tests |
58 | 58 | run: cargo test --verbose |
| 59 | + |
| 60 | + - name: Build release binary for extension tests (macOS ARM64 only) |
| 61 | + if: matrix.target == 'aarch64-apple-darwin' |
| 62 | + run: cargo build --release --target ${{ matrix.target }} |
| 63 | + |
| 64 | + - name: Upload release binary for extension tests (macOS ARM64 only) |
| 65 | + if: matrix.target == 'aarch64-apple-darwin' |
| 66 | + uses: actions/upload-artifact@v4 |
| 67 | + with: |
| 68 | + name: log2src-test-binary |
| 69 | + path: target/${{ matrix.target }}/release/${{ matrix.artifact_name }} |
| 70 | + if-no-files-found: error |
| 71 | + |
| 72 | + vscode-extension-test: |
| 73 | + name: Test VS Code Extension |
| 74 | + needs: [lib-build-and-test] |
| 75 | + runs-on: macos-latest |
| 76 | + timeout-minutes: 15 |
| 77 | + |
| 78 | + steps: |
| 79 | + - name: Checkout repository |
| 80 | + uses: actions/checkout@v4 |
| 81 | + |
| 82 | + - name: Download log2src binary |
| 83 | + uses: actions/download-artifact@v4 |
| 84 | + with: |
| 85 | + name: log2src-test-binary |
| 86 | + path: downloaded-binary |
| 87 | + |
| 88 | + - name: Setup binary for VS Code extension |
| 89 | + run: | |
| 90 | + mkdir -p editors/code/bin/darwin-arm64 |
| 91 | + cp downloaded-binary/log2src editors/code/bin/darwin-arm64/ |
| 92 | + chmod +x editors/code/bin/darwin-arm64/log2src |
| 93 | +
|
| 94 | + - name: Install pnpm |
| 95 | + uses: pnpm/action-setup@v4 |
| 96 | + with: |
| 97 | + version: 10.8.0 |
| 98 | + |
| 99 | + - name: Setup Node.js |
| 100 | + uses: actions/setup-node@v4 |
| 101 | + with: |
| 102 | + node-version: '20' |
| 103 | + cache: 'pnpm' |
| 104 | + cache-dependency-path: 'editors/code/pnpm-lock.yaml' |
| 105 | + |
| 106 | + - name: Install Dependencies |
| 107 | + working-directory: editors/code |
| 108 | + run: pnpm install |
| 109 | + |
| 110 | + - name: Run tests |
| 111 | + working-directory: editors/code |
| 112 | + run: pnpm run test |
59 | 113 |
|
60 | 114 | build-release: |
61 | 115 | name: Build Release |
62 | | - needs: [build-and-test] |
| 116 | + needs: [lib-build-and-test] |
63 | 117 | if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') |
64 | 118 | runs-on: ${{ matrix.os }} |
65 | 119 | timeout-minutes: 30 |
|
0 commit comments