|
| 1 | +name: build |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + release: |
| 9 | + types: [published] |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: read |
| 13 | + |
| 14 | +jobs: |
| 15 | + save_pr_metadata: |
| 16 | + name: Save PR metadata |
| 17 | + runs-on: ubuntu-latest |
| 18 | + if: github.event_name == 'pull_request' |
| 19 | + steps: |
| 20 | + - name: Save PR metadata |
| 21 | + run: | |
| 22 | + mkdir -p ./pr_metadata |
| 23 | + echo "${{ github.event.number }}" > ./pr_metadata/pr_number |
| 24 | + echo "${{ github.event.pull_request.head.ref }}" > ./pr_metadata/pr_branch |
| 25 | + echo "${{ github.event.pull_request.head.sha }}" > ./pr_metadata/pr_sha |
| 26 | + echo "${{ github.event.pull_request.head.repo.full_name }}" > ./pr_metadata/pr_repo |
| 27 | + echo "${{ github.event.pull_request.base.ref }}" > ./pr_metadata/base_ref |
| 28 | +
|
| 29 | + - name: Upload PR metadata |
| 30 | + uses: actions/upload-artifact@v4 |
| 31 | + with: |
| 32 | + name: pr_metadata |
| 33 | + path: pr_metadata/ |
| 34 | + |
| 35 | + build_dev_docs: |
| 36 | + name: Build developer docs |
| 37 | + runs-on: ubuntu-latest |
| 38 | + steps: |
| 39 | + - name: Checkout repository |
| 40 | + uses: actions/checkout@v4 |
| 41 | + |
| 42 | + - name: Setup pnpm |
| 43 | + uses: pnpm/action-setup@v4 |
| 44 | + |
| 45 | + - name: Setup NodeJS |
| 46 | + uses: actions/setup-node@v4 |
| 47 | + with: |
| 48 | + node-version: 24 |
| 49 | + cache: "pnpm" |
| 50 | + |
| 51 | + - name: Build developer docs |
| 52 | + run: | |
| 53 | + pnpm install |
| 54 | + pnpm --filter ./dev-docs run doc |
| 55 | +
|
| 56 | + - name: Upload developer docs |
| 57 | + uses: actions/upload-artifact@v4 |
| 58 | + with: |
| 59 | + name: dev-docs |
| 60 | + path: dev-docs/output |
| 61 | + |
| 62 | + build_frontend: |
| 63 | + name: Build frontend |
| 64 | + runs-on: ubuntu-latest |
| 65 | + steps: |
| 66 | + - name: Checkout repository |
| 67 | + uses: actions/checkout@v4 |
| 68 | + |
| 69 | + - name: Setup pnpm |
| 70 | + uses: pnpm/action-setup@v4 |
| 71 | + |
| 72 | + - name: Setup NodeJS |
| 73 | + uses: actions/setup-node@v4 |
| 74 | + with: |
| 75 | + node-version: 24 |
| 76 | + cache: "pnpm" |
| 77 | + |
| 78 | + - name: Install Rust toolchain from file |
| 79 | + uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 80 | + with: |
| 81 | + # Don't override flags in cargo config files. |
| 82 | + rustflags: "" |
| 83 | + |
| 84 | + - name: Build for Staging |
| 85 | + if: github.event_name == 'push' || github.event_name == 'pull_request' |
| 86 | + run: | |
| 87 | + pnpm install |
| 88 | + pnpm --filter ./packages/frontend run build -- --mode staging |
| 89 | +
|
| 90 | + - name: Build for Production |
| 91 | + if: github.event_name == 'release' |
| 92 | + run: | |
| 93 | + pnpm install |
| 94 | + pnpm --filter ./packages/frontend run build |
| 95 | +
|
| 96 | + - name: Upload |
| 97 | + uses: actions/upload-artifact@v4 |
| 98 | + with: |
| 99 | + name: app |
| 100 | + path: packages/frontend/dist |
| 101 | + |
| 102 | + - name: Build frontend docs |
| 103 | + run: | |
| 104 | + pnpm --filter ./packages/frontend run doc |
| 105 | +
|
| 106 | + - name: Upload frontend docs |
| 107 | + uses: actions/upload-artifact@v4 |
| 108 | + with: |
| 109 | + name: frontend_docs |
| 110 | + path: packages/frontend/docs |
| 111 | + |
| 112 | + build_rust_docs: |
| 113 | + name: Build Rust docs |
| 114 | + runs-on: ubuntu-latest |
| 115 | + steps: |
| 116 | + - name: Checkout repository |
| 117 | + uses: actions/checkout@v4 |
| 118 | + |
| 119 | + - name: Install Rust toolchain from file |
| 120 | + uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 121 | + |
| 122 | + - name: Build Rust docs |
| 123 | + run: | |
| 124 | + cargo doc --all-features --no-deps --workspace --exclude "migrator" |
| 125 | +
|
| 126 | + - name: Upload Rust docs |
| 127 | + uses: actions/upload-artifact@v4 |
| 128 | + with: |
| 129 | + name: rust_docs |
| 130 | + path: target/doc |
| 131 | + |
| 132 | + build_math-docs: |
| 133 | + name: Build mathematical docs |
| 134 | + runs-on: ubuntu-latest |
| 135 | + steps: |
| 136 | + - name: Repository Checkout |
| 137 | + uses: actions/checkout@v4 |
| 138 | + |
| 139 | + - name: Setup TinyTeX |
| 140 | + uses: r-lib/actions/setup-tinytex@v2 |
| 141 | + |
| 142 | + - name: Install TeX Packages |
| 143 | + run: | |
| 144 | + tlmgr update --self |
| 145 | + tlmgr install dvisvgm |
| 146 | + tlmgr install standalone |
| 147 | + tlmgr install pgf |
| 148 | + tlmgr install tikz-cd |
| 149 | + tlmgr install amsmath |
| 150 | + tlmgr install quiver |
| 151 | + tlmgr install spath3 |
| 152 | +
|
| 153 | + - name: Build mathematical docs |
| 154 | + run: | |
| 155 | + cd math-docs |
| 156 | + ./forester build |
| 157 | +
|
| 158 | + - name: Upload mathematical docs |
| 159 | + uses: actions/upload-artifact@v4 |
| 160 | + with: |
| 161 | + name: math-docs |
| 162 | + path: math-docs/output |
| 163 | + |
| 164 | + build_ui_components: |
| 165 | + name: Build ui-components Storybook |
| 166 | + runs-on: ubuntu-latest |
| 167 | + steps: |
| 168 | + - name: Checkout repository |
| 169 | + uses: actions/checkout@v4 |
| 170 | + |
| 171 | + - name: Setup pnpm |
| 172 | + uses: pnpm/action-setup@v4 |
| 173 | + |
| 174 | + - name: Setup NodeJS |
| 175 | + uses: actions/setup-node@v4 |
| 176 | + with: |
| 177 | + node-version: 24 |
| 178 | + cache: "pnpm" |
| 179 | + |
| 180 | + - name: Install dependencies |
| 181 | + run: pnpm install |
| 182 | + |
| 183 | + - name: Build ui-components Storybook |
| 184 | + run: pnpm --filter ./packages/ui-components run build |
| 185 | + |
| 186 | + - name: Upload ui-components Storybook |
| 187 | + uses: actions/upload-artifact@v4 |
| 188 | + with: |
| 189 | + name: ui-components |
| 190 | + path: packages/ui-components/storybook-static |
0 commit comments