|
| 1 | +# Copyright (C) 2020 Matthew Glazar |
| 2 | +# See end of file for extended copyright information. |
| 3 | + |
| 4 | +name: build website |
| 5 | +on: |
| 6 | + push: |
| 7 | + pull_request: |
| 8 | + types: [opened, synchronize] |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + name: website |
| 13 | + runs-on: ubuntu-latest |
| 14 | + container: ghcr.io/quick-lint/quick-lint-js-github-builder:v1 |
| 15 | + env: |
| 16 | + QLJS_COLLECT_COPYRIGHT_NO_WARNINGS: 1 |
| 17 | + steps: |
| 18 | + - uses: mymindstorm/setup-emsdk@v7 |
| 19 | + with: |
| 20 | + version: 2.0.4 |
| 21 | + - name: checkout |
| 22 | + uses: actions/checkout@v2 |
| 23 | + |
| 24 | + - name: C++ configure |
| 25 | + run: emcmake cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS='-Os -flto' -DCMAKE_CXX_FLAGS='-Os -fno-rtti -fno-exceptions -flto' |
| 26 | + - name: C++ build |
| 27 | + run: emmake cmake --build build --target quick-lint-js-wasm-demo quick-lint-js-wasm-demo-licenses quick-lint-js-vscode quick-lint-js-vscode-licenses |
| 28 | + - name: C++ install (web demo) |
| 29 | + run: emmake cmake --install build --component wasm-demo --prefix website/public/demo |
| 30 | + - name: C++ install (quick-lint-js-wasm) |
| 31 | + run: emmake cmake --install build --component vscode --prefix wasm |
| 32 | + |
| 33 | + - name: JS configure |
| 34 | + run: cd website && yarn |
| 35 | + - name: JS test |
| 36 | + run: cd website && yarn test demo/test-demo.mjs |
| 37 | + |
| 38 | + - name: build site |
| 39 | + run: cd website && yarn build |
| 40 | + - name: bundle site |
| 41 | + run: cd website && zip -r ../website.zip www |
| 42 | + |
| 43 | + - name: upload build to workflow |
| 44 | + uses: actions/upload-artifact@v2 |
| 45 | + with: |
| 46 | + if-no-files-found: error |
| 47 | + name: website-${{ github.sha }} |
| 48 | + path: website/www/ |
| 49 | + - name: upload build to long-term storage |
| 50 | + if: ${{ github.event_name == 'push' }} |
| 51 | + uses: quick-lint/sftp-upload@master |
| 52 | + with: |
| 53 | + host: ${{ secrets.artifacts_host }} |
| 54 | + local-file-globs: website.zip |
| 55 | + private-key: ${{ secrets.artifacts_key }} |
| 56 | + remote-directory: ${{ secrets.artifacts_root }}/builds/${{ github.sha }}/website/ |
| 57 | + user: ${{ secrets.artifacts_user }} |
| 58 | + |
| 59 | +# quick-lint-js finds bugs in JavaScript programs. |
| 60 | +# Copyright (C) 2020 Matthew Glazar |
| 61 | +# |
| 62 | +# This file is part of quick-lint-js. |
| 63 | +# |
| 64 | +# quick-lint-js is free software: you can redistribute it and/or modify |
| 65 | +# it under the terms of the GNU General Public License as published by |
| 66 | +# the Free Software Foundation, either version 3 of the License, or |
| 67 | +# (at your option) any later version. |
| 68 | +# |
| 69 | +# quick-lint-js is distributed in the hope that it will be useful, |
| 70 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 71 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 72 | +# GNU General Public License for more details. |
| 73 | +# |
| 74 | +# You should have received a copy of the GNU General Public License |
| 75 | +# along with quick-lint-js. If not, see <https://www.gnu.org/licenses/>. |
0 commit comments