|
1 | | -name: Rust CI |
| 1 | +name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: |
6 | | - - main |
7 | | - paths: |
8 | | - - "**" |
| 5 | + branches: [main] |
9 | 6 | pull_request: |
10 | 7 | types: [opened, synchronize, reopened, ready_for_review] |
11 | | - branches: |
12 | | - - main |
13 | | - paths: |
14 | | - - "**" |
| 8 | + branches: [main] |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: read |
15 | 12 |
|
16 | 13 | concurrency: |
17 | 14 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
18 | 15 | cancel-in-progress: true |
19 | 16 |
|
20 | 17 | jobs: |
21 | 18 | check: |
22 | | - if: github.event.pull_request.draft == false |
23 | | - name: Check |
24 | | - runs-on: ubuntu-latest |
25 | | - steps: |
26 | | - - uses: actions/checkout@v4 |
27 | | - - uses: awalsh128/cache-apt-pkgs-action@latest |
28 | | - with: |
29 | | - packages: libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev |
30 | | - version: 1.0 |
31 | | - - uses: dtolnay/rust-toolchain@stable |
32 | | - - uses: Swatinem/rust-cache@v2 |
33 | | - with: |
34 | | - cache-all-crates: "true" |
35 | | - cache-on-failure: "false" |
36 | | - - name: Check |
37 | | - run: cargo check --workspace --all-features |
| 19 | + uses: ealmloff/dioxus-ci/.github/workflows/check.yml@main |
| 20 | + with: |
| 21 | + all-features: false |
| 22 | + no-default-features: true |
| 23 | + features: dioxus-code/all-languages dioxus-code-editor/web dioxus-code-demo/web dioxus-code-live-input/web |
38 | 24 |
|
39 | 25 | test: |
40 | | - if: github.event.pull_request.draft == false |
41 | | - name: Test Suite |
42 | | - runs-on: ubuntu-24.04 |
43 | | - steps: |
44 | | - - uses: actions/checkout@v4 |
45 | | - - name: Free Disk Space |
46 | | - uses: ./.github/actions/free-disk-space |
47 | | - - uses: awalsh128/cache-apt-pkgs-action@latest |
48 | | - with: |
49 | | - packages: libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev |
50 | | - version: 1.0 |
51 | | - - uses: dtolnay/rust-toolchain@stable |
52 | | - with: |
53 | | - components: rustfmt, clippy |
54 | | - - uses: Swatinem/rust-cache@v2 |
55 | | - with: |
56 | | - cache-all-crates: "true" |
57 | | - - uses: browser-actions/setup-firefox@latest |
58 | | - - name: Test |
59 | | - run: cargo test --workspace |
| 26 | + uses: ealmloff/dioxus-ci/.github/workflows/test.yml@main |
| 27 | + with: |
| 28 | + no-default-features: true |
| 29 | + features: dioxus-code/all-languages dioxus-code-editor/web dioxus-code-demo/web dioxus-code-live-input/web |
60 | 30 |
|
61 | 31 | fmt: |
62 | | - if: github.event.pull_request.draft == false |
63 | | - name: Rustfmt |
64 | | - runs-on: ubuntu-24.04 |
65 | | - steps: |
66 | | - - uses: actions/checkout@v4 |
67 | | - - uses: dtolnay/rust-toolchain@stable |
68 | | - with: |
69 | | - components: rustfmt |
70 | | - - uses: Swatinem/rust-cache@v2 |
71 | | - with: |
72 | | - cache-all-crates: "true" |
73 | | - - name: Format |
74 | | - run: cargo fmt --all -- --check |
| 32 | + uses: ealmloff/dioxus-ci/.github/workflows/fmt.yml@main |
75 | 33 |
|
76 | 34 | docs: |
77 | | - if: github.event.pull_request.draft == false |
78 | | - name: Docs |
79 | | - runs-on: ubuntu-24.04 |
80 | | - steps: |
81 | | - - uses: actions/checkout@v4 |
82 | | - - uses: awalsh128/cache-apt-pkgs-action@latest |
83 | | - with: |
84 | | - packages: libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev |
85 | | - version: 1.0 |
86 | | - - uses: dtolnay/rust-toolchain@nightly |
87 | | - - uses: Swatinem/rust-cache@v2 |
88 | | - with: |
89 | | - cache-all-crates: "true" |
90 | | - - name: Docs |
91 | | - run: cargo doc --workspace --no-deps --all-features --document-private-items |
92 | | - env: |
93 | | - RUSTDOCFLAGS: -Dwarnings --document-private-items |
| 35 | + uses: ealmloff/dioxus-ci/.github/workflows/docs.yml@main |
| 36 | + with: |
| 37 | + all-features: false |
| 38 | + no-default-features: true |
| 39 | + features: dioxus-code/all-languages dioxus-code-editor/web dioxus-code-demo/web dioxus-code-live-input/web |
94 | 40 |
|
95 | 41 | clippy: |
96 | | - if: github.event.pull_request.draft == false |
97 | | - name: Clippy |
98 | | - runs-on: ubuntu-24.04 |
99 | | - steps: |
100 | | - - uses: actions/checkout@v4 |
101 | | - - uses: awalsh128/cache-apt-pkgs-action@latest |
102 | | - with: |
103 | | - packages: libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev |
104 | | - version: 1.0 |
105 | | - - uses: dtolnay/rust-toolchain@stable |
106 | | - with: |
107 | | - components: rustfmt, clippy |
108 | | - - uses: Swatinem/rust-cache@v2 |
109 | | - with: |
110 | | - cache-all-crates: "true" |
111 | | - - name: Clippy |
112 | | - run: cargo clippy --workspace --examples --tests --all-features --all-targets -- -D warnings |
| 42 | + uses: ealmloff/dioxus-ci/.github/workflows/clippy.yml@main |
| 43 | + with: |
| 44 | + all-features: false |
| 45 | + no-default-features: true |
| 46 | + features: dioxus-code/all-languages dioxus-code-editor/web dioxus-code-demo/web dioxus-code-live-input/web |
113 | 47 |
|
114 | 48 | web-demo: |
115 | | - if: github.event.pull_request.draft == false |
116 | | - name: Web Demo |
117 | | - runs-on: ubuntu-latest |
118 | | - env: |
119 | | - CARGO_INCREMENTAL: 1 |
120 | | - steps: |
121 | | - - uses: actions/checkout@v4 |
122 | | - - uses: awalsh128/cache-apt-pkgs-action@latest |
123 | | - with: |
124 | | - packages: libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev |
125 | | - version: 1.0 |
126 | | - - uses: dtolnay/rust-toolchain@stable |
127 | | - with: |
128 | | - targets: x86_64-unknown-linux-gnu,wasm32-unknown-unknown |
129 | | - - uses: Swatinem/rust-cache@v2 |
130 | | - with: |
131 | | - cache-all-crates: "true" |
132 | | - cache-on-failure: "false" |
133 | | - cache-directories: "target/dx" |
134 | | - - uses: cargo-bins/cargo-binstall@main |
135 | | - - name: Install Dioxus CLI |
136 | | - run: cargo binstall dioxus-cli -y --force --version 0.7.7 |
137 | | - - name: Build web demo |
138 | | - run: cd demo && dx build --web --release --no-default-features --features web --debug-symbols false --base-path "${{ github.event.repository.name }}" |
| 49 | + uses: ealmloff/dioxus-ci/.github/workflows/web-build.yml@main |
| 50 | + with: |
| 51 | + working-directory: demo |
| 52 | + no-default-features: true |
| 53 | + features: web |
| 54 | + debug-symbols: false |
| 55 | + base-path: ${{ github.event.repository.name }} |
| 56 | + dx-cli-version: 0.7.7 |
0 commit comments