refactor(examples): basic: fix clippy warning; #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy doc and examples | |
env: | |
PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} | |
GCP_BUCKET: ${{ secrets.GCP_BUCKET }} | |
on: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
check: | |
name: Check library code | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: 'Add nightly channel' | |
run: 'rustup toolchain install nightly' | |
- name: 'Add nightly fmt' | |
run: 'rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu' | |
- name: 'Fmt' | |
run: 'cargo +nightly fmt --all -- --check' | |
- name: 'Clippy' | |
run: 'cargo clippy --all-features --all-targets -- -D warnings' | |
check-examples-matrix: | |
strategy: | |
matrix: | |
example: [basic, custom, terminal] | |
runs-on: ubuntu-latest | |
name: Check ${{ matrix.example }} code | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: 'Add nightly channel' | |
run: 'rustup toolchain install nightly' | |
- name: 'Add nightly fmt' | |
run: 'rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu' | |
- name: 'Fmt' | |
run: 'cd examples/${{ matrix.example }} && cargo +nightly fmt --all -- --check' | |
- name: 'Clippy' | |
run: 'cd examples/${{ matrix.example }} && cargo clippy --all-targets --all-features -- -D warnings' | |
deploy-documentation: | |
name: Deploy documentation | |
runs-on: ubuntu-latest | |
needs: check | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- id: 'auth' | |
name: 'Authenticate to Google Cloud' | |
uses: 'google-github-actions/auth@v0' | |
with: | |
credentials_json: '${{ secrets.GCP_SERVICE_KEY }}' | |
- name: 'Build documentation' | |
run: 'mkdir doc && cargo doc --release --target-dir doc --all-features -p yew-notifications --no-deps --color always' | |
- name: 'Set up Cloud SDK' | |
uses: google-github-actions/setup-gcloud@v0 | |
- name: 'Deploy documentation' | |
run: 'gsutil -h "Cache-Control:no-store" -m cp -r doc/doc/* gs://${GCP_BUCKET}' | |
deploy-examples-matrix: | |
strategy: | |
matrix: | |
example: [basic, custom, terminal] | |
runs-on: ubuntu-latest | |
needs: [check, check-examples-matrix] | |
name: Deploy ${{ matrix.example }} example | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: 'Trunk Check' | |
uses: jetli/trunk-action@v0.4.0 | |
- id: 'auth' | |
name: 'Authenticate to Google Cloud' | |
uses: 'google-github-actions/auth@v0' | |
with: | |
credentials_json: '${{ secrets.GCP_SERVICE_KEY }}' | |
- name: 'Add WASM target' | |
run: 'rustup target add wasm32-unknown-unknown' | |
- name: 'Build' | |
run: 'cd examples/${{ matrix.example }} && trunk build --release --public-url /examples/${{ matrix.example }}' | |
- name: 'Set up Cloud SDK' | |
uses: google-github-actions/setup-gcloud@v0 | |
- name: 'Deploy documentation' | |
run: 'gsutil -h "Cache-Control:no-store" -m cp -r examples/${{ matrix.example }}/dist/* gs://${GCP_BUCKET}/examples/${{ matrix.example }}' |