|
1 | | -# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node |
2 | | -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions |
3 | | - |
4 | | -name: Wasp-HLS PR check |
| 1 | +name: CI |
5 | 2 |
|
6 | 3 | on: |
7 | 4 | push: |
8 | 5 | branches: [stable, dev, legacy-v3] |
9 | 6 | pull_request: |
10 | | - types: [opened, synchronize, reopened] |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + |
| 16 | +env: |
| 17 | + CARGO_TERM_COLOR: always |
| 18 | + WASM_BINDGEN_CLI_VERSION: 0.2.120 |
11 | 19 |
|
12 | 20 | jobs: |
13 | 21 | format_check: |
| 22 | + name: Format check |
14 | 23 | runs-on: ubuntu-latest |
15 | | - |
16 | | - strategy: |
17 | | - matrix: |
18 | | - node-version: [20.x] |
19 | | - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ |
| 24 | + timeout-minutes: 15 |
20 | 25 |
|
21 | 26 | steps: |
22 | | - - uses: actions/checkout@v2 |
23 | | - - name: Use Node.js ${{ matrix.node-version }} |
24 | | - uses: actions/setup-node@v2 |
25 | | - with: |
26 | | - node-version: ${{ matrix.node-version }} |
27 | | - cache: "npm" |
28 | | - - uses: actions-rs/toolchain@v1 |
| 27 | + - uses: actions/checkout@v5 |
| 28 | + |
| 29 | + - name: Set up Node.js |
| 30 | + uses: actions/setup-node@v6 |
29 | 31 | with: |
30 | | - toolchain: stable |
| 32 | + node-version: 24 |
| 33 | + cache: npm |
31 | 34 |
|
32 | | - - run: npm install |
33 | | - - run: rustup component add rustfmt |
34 | | - - run: npm run fmt:check |
35 | | - - run: npm run fmt:check |
| 35 | + - name: Set up Rust |
| 36 | + run: rustup component add rustfmt |
36 | 37 |
|
37 | | - typechecking_and_linting: |
38 | | - runs-on: ubuntu-latest |
| 38 | + - name: Install dependencies |
| 39 | + run: npm ci |
39 | 40 |
|
40 | | - strategy: |
41 | | - matrix: |
42 | | - node-version: [20.x] |
43 | | - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ |
| 41 | + - name: Check formatting |
| 42 | + run: npm run fmt:check |
| 43 | + |
| 44 | + code_quality: |
| 45 | + name: Typecheck, lint, clippy, and debug build |
| 46 | + runs-on: ubuntu-latest |
| 47 | + timeout-minutes: 30 |
44 | 48 |
|
45 | 49 | steps: |
46 | | - - uses: actions/checkout@v2 |
47 | | - - name: Use Node.js ${{ matrix.node-version }} |
48 | | - uses: actions/setup-node@v2 |
| 50 | + - uses: actions/checkout@v5 |
| 51 | + |
| 52 | + - name: Set up Node.js |
| 53 | + uses: actions/setup-node@v6 |
| 54 | + with: |
| 55 | + node-version: 24 |
| 56 | + cache: npm |
| 57 | + |
| 58 | + - name: Set up Rust |
| 59 | + run: | |
| 60 | + rustup target add wasm32-unknown-unknown |
| 61 | + rustup component add clippy |
| 62 | +
|
| 63 | + - name: Cache cargo registry |
| 64 | + uses: actions/cache@v4 |
49 | 65 | with: |
50 | | - node-version: ${{ matrix.node-version }} |
51 | | - cache: "npm" |
52 | | - - uses: actions-rs/toolchain@v1 |
| 66 | + path: | |
| 67 | + ~/.cargo/registry |
| 68 | + ~/.cargo/git |
| 69 | + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} |
| 70 | + restore-keys: | |
| 71 | + ${{ runner.os }}-cargo-registry- |
| 72 | +
|
| 73 | + - name: Cache cargo binaries |
| 74 | + uses: actions/cache@v4 |
53 | 75 | with: |
54 | | - toolchain: stable |
| 76 | + path: ~/.cargo/bin |
| 77 | + key: ${{ runner.os }}-cargo-bin-wasm-bindgen-${{ env.WASM_BINDGEN_CLI_VERSION }} |
55 | 78 |
|
56 | | - - run: npm install |
57 | | - - run: rustup target add wasm32-unknown-unknown |
58 | | - - run: rustup component add clippy |
59 | | - - run: cargo install wasm-bindgen-cli@0.2.93 |
60 | | - - run: npm run build:all |
61 | | - - run: npm run check |
62 | | - - run: npm run clippy |
| 79 | + - name: Cache Rust target |
| 80 | + uses: actions/cache@v4 |
| 81 | + with: |
| 82 | + path: target |
| 83 | + key: ${{ runner.os }}-target-quality-${{ hashFiles('**/Cargo.lock') }} |
| 84 | + restore-keys: | |
| 85 | + ${{ runner.os }}-target-quality- |
| 86 | +
|
| 87 | + - name: Install wasm-bindgen-cli |
| 88 | + run: cargo install wasm-bindgen-cli --version ${{ env.WASM_BINDGEN_CLI_VERSION }} --locked |
| 89 | + |
| 90 | + - name: Install dependencies |
| 91 | + run: npm ci |
| 92 | + |
| 93 | + - name: Build debug artifacts |
| 94 | + run: npm run build:all |
| 95 | + |
| 96 | + - name: Typecheck and lint |
| 97 | + run: npm run check |
| 98 | + |
| 99 | + - name: Run clippy |
| 100 | + run: npm run clippy |
63 | 101 |
|
64 | 102 | release_build: |
| 103 | + name: Release build |
65 | 104 | runs-on: ubuntu-latest |
66 | | - |
67 | | - strategy: |
68 | | - matrix: |
69 | | - node-version: [20.x] |
70 | | - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ |
| 105 | + timeout-minutes: 30 |
71 | 106 |
|
72 | 107 | steps: |
73 | | - - uses: actions/checkout@v2 |
74 | | - - name: Use Node.js ${{ matrix.node-version }} |
75 | | - uses: actions/setup-node@v2 |
| 108 | + - uses: actions/checkout@v5 |
| 109 | + |
| 110 | + - name: Set up Node.js |
| 111 | + uses: actions/setup-node@v6 |
76 | 112 | with: |
77 | | - node-version: ${{ matrix.node-version }} |
78 | | - cache: "npm" |
79 | | - - uses: actions-rs/toolchain@v1 |
| 113 | + node-version: 24 |
| 114 | + cache: npm |
| 115 | + |
| 116 | + - name: Set up Rust |
| 117 | + run: rustup target add wasm32-unknown-unknown |
| 118 | + |
| 119 | + - name: Cache cargo registry |
| 120 | + uses: actions/cache@v4 |
| 121 | + with: |
| 122 | + path: | |
| 123 | + ~/.cargo/registry |
| 124 | + ~/.cargo/git |
| 125 | + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} |
| 126 | + restore-keys: | |
| 127 | + ${{ runner.os }}-cargo-registry- |
| 128 | +
|
| 129 | + - name: Cache cargo binaries |
| 130 | + uses: actions/cache@v4 |
80 | 131 | with: |
81 | | - toolchain: stable |
| 132 | + path: ~/.cargo/bin |
| 133 | + key: ${{ runner.os }}-cargo-bin-wasm-bindgen-${{ env.WASM_BINDGEN_CLI_VERSION }} |
| 134 | + |
| 135 | + - name: Cache Rust target |
| 136 | + uses: actions/cache@v4 |
| 137 | + with: |
| 138 | + path: target |
| 139 | + key: ${{ runner.os }}-target-release-${{ hashFiles('**/Cargo.lock') }} |
| 140 | + restore-keys: | |
| 141 | + ${{ runner.os }}-target-release- |
| 142 | +
|
| 143 | + - name: Install wasm-bindgen-cli |
| 144 | + run: cargo install wasm-bindgen-cli --version ${{ env.WASM_BINDGEN_CLI_VERSION }} --locked |
| 145 | + |
| 146 | + - name: Install dependencies |
| 147 | + run: npm ci |
82 | 148 |
|
83 | | - - run: npm install |
84 | | - - run: rustup target add wasm32-unknown-unknown |
85 | | - - run: rustup component add clippy |
86 | | - - run: cargo install wasm-bindgen-cli@0.2.93 |
87 | | - - run: npm run build:release |
| 149 | + - name: Build release artifacts |
| 150 | + run: npm run build:release |
0 commit comments