Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 108 additions & 59 deletions .github/workflows/all_components.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,112 @@
# name: Add All Components
name: Add Components

# on:
# push:
# branches:
# - main
# paths:
# - /**
# - preview/**/*.rs
# - preview/**/Cargo.toml
# - primitives/**/*.rs
# - primitives/**/Cargo.toml
# - .github/**
# - Cargo.toml
on:
push:
branches:
- main
paths:
- /**
- preview/**/*.rs
- preview/**/Cargo.toml
- primitives/**/*.rs
- primitives/**/Cargo.toml
- .github/**
- Cargo.toml

# pull_request:
# types: [opened, synchronize, reopened, ready_for_review]
# branches:
# - main
# paths:
# - /**
# - preview/**/*.rs
# - preview/**/Cargo.toml
# - primitives/**/*.rs
# - primitives/**/Cargo.toml
# - .github/**
# - Cargo.toml
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
paths:
- /**
- preview/**/*.rs
- preview/**/Cargo.toml
- primitives/**/*.rs
- primitives/**/Cargo.toml
- .github/**
- Cargo.toml

# concurrency:
# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# cancel-in-progress: true
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

# jobs:
# deploy-preview:
# if: github.event.pull_request.draft == false
# name: Add All Components
# runs-on: ubuntu-latest
# env:
# CARGO_INCREMENTAL: 1
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# ref: "refs/pull/${{ github.event.pull_request.number }}/merge"
# fetch-depth: 0
# - uses: awalsh128/cache-apt-pkgs-action@latest
# with:
# packages: libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev
# version: 1.0
# - name: Install Rust
# uses: dtolnay/rust-toolchain@master
# with:
# toolchain: stable
# targets: x86_64-unknown-linux-gnu,wasm32-unknown-unknown
# - uses: Swatinem/rust-cache@v2
# with:
# cache-all-crates: "true"
# cache-on-failure: "false"
# - uses: cargo-bins/cargo-binstall@main
# - name: Install CLI
# run: cargo binstall dioxus-cli -y --force --version 0.7.0-rc.3
# - name: Add components and check
# run: cd test-harness && dx components add --all --path .. --force && cargo check --all-features
jobs:
add-all-components:
if: github.event.pull_request.draft == false
name: Add All Components
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: 1
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: "refs/pull/${{ github.event.pull_request.number }}/merge"
fetch-depth: 0
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev
version: 1.0
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: x86_64-unknown-linux-gnu,wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: "true"
cache-on-failure: "false"
- name: Install CLI
run: cargo install dioxus-cli --git https://github.com/DioxusLabs/dioxus
- name: Add components and check
run: cd test-harness && dx components add --all --path .. --force && cargo check --all-features
add-each-component:
if: github.event.pull_request.draft == false
name: Add Each Components
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: 1
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: "refs/pull/${{ github.event.pull_request.number }}/merge"
fetch-depth: 0
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev
version: 1.0
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: x86_64-unknown-linux-gnu,wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: "true"
cache-on-failure: "false"
- name: Install CLI
run: cargo install dioxus-cli --git https://github.com/DioxusLabs/dioxus
- name: Add each component and check
run: |
cd preview/src/components/
for file in *; do
if [ -d "$file" ]; then
echo "Testing component: $file"
else
continue
fi
# Go to test harness
cd ../../../test-harness
# Add dependencies manually; TODO: remove this once dx components supports local dependencies
if [ "$file" = "date_picker" ]; then
dx components add calendar,popover --path ..
fi
# Add the component
dx components add "$file" --path ..
# Make sure it still builds
cargo check --all-features
# Undo changes
dx components remove --all --path ..
cd ../preview/src/components/
done
1 change: 1 addition & 0 deletions preview/src/components/date_picker/component.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"git": "https://github.com/DioxusLabs/components"
}
],
"componentDependencies": ["calendar", "popover"],
"globalAssets": ["../../../assets/dx-components-theme.css"]
}
Loading