Skip to content

Commit

Permalink
feat: support embed sass (#161)
Browse files Browse the repository at this point in the history
* feat: support embed sass

* feat: add plugin sass config

* fix: support for different systems

* feat: transform hook

* fix: postinstall

* feat: add plugin-sass ci

* feat: add test case

* fix: ci

* fix: ci error

* chore: update package lock

* feat: resolve download sass-embedded

* feat: remove unused files

* fix: windows not found file

* fix: test ci

* fix: lint

* fix: test ci

---------

Co-authored-by: brightwu <[email protected]>
  • Loading branch information
callqh and wre232114 authored Apr 9, 2023
1 parent f3fae53 commit dee4a1d
Show file tree
Hide file tree
Showing 31 changed files with 1,227 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
- name: Install Rust
uses: oxidecomputer/actions-rs_toolchain@oxide/master
- uses: Swatinem/rust-cache@v1
- uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run cargo fmt
run: cargo fmt
Expand Down
46 changes: 45 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,20 @@ jobs:
root: rust-plugins/react
name: plugin-react

call-rust-plugin-sass-build:
uses: ./.github/workflows/rust-plugin-build.yaml
with:
root: rust-plugins/sass
name: plugin-sass

release:
name: Release
needs: [call-rust-build, call-rust-plugin-react-build]
needs:
[
call-rust-build,
call-rust-plugin-react-build,
call-rust-plugin-sass-build,
]
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
Expand Down Expand Up @@ -95,6 +106,39 @@ jobs:
- name: List Files
run: ls -l ./rust-plugins/react/npm/darwin-arm64

# download rust plugin sass artifacts
- uses: actions/download-artifact@v3
id: download-plugin-sass-linux-x64-gnu
with:
name: ${{ github.sha }}-linux-x64-gnu-plugin-sass
path: ./rust-plugins/sass/npm/linux-x64-gnu
- name: List Files
run: ls -l ./rust-plugins/sass/npm/linux-x64-gnu

- uses: actions/download-artifact@v3
id: download-plugin-sass-darwin-x64
with:
name: ${{ github.sha }}-darwin-x64-plugin-sass
path: ./rust-plugins/sass/npm/darwin-x64
- name: List Files
run: ls -l ./rust-plugins/sass/npm/darwin-x64

- uses: actions/download-artifact@v3
id: download-plugin-sass-win32-x64-msvc
with:
name: ${{ github.sha }}-win32-x64-msvc-plugin-sass
path: ./rust-plugins/sass/npm/win32-x64-msvc
- name: List Files
run: ls -l ./rust-plugins/sass/npm/win32-x64-msvc

- uses: actions/download-artifact@v3
id: download-plugin-sass-darwin-arm64
with:
name: ${{ github.sha }}-darwin-arm64-plugin-sass
path: ./rust-plugins/sass/npm/darwin-arm64
- name: List Files
run: ls -l ./rust-plugins/sass/npm/darwin-arm64

- name: Install Dependencies
run: npm install -g pnpm@7 && pnpm i --frozen-lockfile

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/rust-plugin-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Dependencies
run: npm install -g pnpm@7 && pnpm i --frozen-lockfile
- run: rustup target add aarch64-apple-darwin
Expand Down Expand Up @@ -64,6 +67,9 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Dependencies
run: npm install -g pnpm@7 && pnpm i --frozen-lockfile
- name: Build Farm cli
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/rust-plugin-sass-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Plugin Sass CI
on:
pull_request:
paths:
- 'rust-plugins/**'

jobs:
call-rust-plugin-sass-build:
uses: ./.github/workflows/rust-plugin-build.yaml
with:
root: rust-plugins/sass
name: plugin-sass

check-plugin-artifacts:
name: Check Plugin Artifacts
runs-on: ubuntu-latest
needs: call-rust-plugin-sass-build
steps:
# download rust plugin sass artifacts
- uses: actions/download-artifact@v3
id: download-plugin-sass-linux-x64-gnu
with:
name: ${{ github.sha }}-linux-x64-gnu-plugin-sass
path: ./rust-plugins/sass/npm/linux-x64-gnu
- name: List Files
run: ls -l ./rust-plugins/sass/npm/linux-x64-gnu/index.farm

- uses: actions/download-artifact@v3
id: download-darwin-x64
with:
name: ${{ github.sha }}-darwin-x64-plugin-sass
path: ./rust-plugins/sass/npm/darwin-x64
- name: List Files
run: ls -l ./rust-plugins/sass/npm/darwin-x64/index.farm

- uses: actions/download-artifact@v3
id: download-win32-x64-msvc
with:
name: ${{ github.sha }}-win32-x64-msvc-plugin-sass
path: ./rust-plugins/sass/npm/win32-x64-msvc
- name: List Files
run: ls -l ./rust-plugins/sass/npm/win32-x64-msvc/index.farm

- uses: actions/download-artifact@v3
id: download-darwin-arm64
with:
name: ${{ github.sha }}-darwin-arm64-plugin-sass
path: ./rust-plugins/sass/npm/darwin-arm64
- name: List Files
run: ls -l ./rust-plugins/sass/npm/darwin-arm64/index.farm
19 changes: 19 additions & 0 deletions .github/workflows/rust-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
- name: Install Rust
uses: oxidecomputer/actions-rs_toolchain@oxide/master
- uses: Swatinem/rust-cache@v1
- uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run cargo check
run: cargo check --color always --all --all-targets
Expand All @@ -32,6 +35,14 @@ jobs:
- name: Install Rust
uses: oxidecomputer/actions-rs_toolchain@oxide/master
- uses: Swatinem/rust-cache@v1
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Dependencies
run: npm install -g pnpm@7 && pnpm i --frozen-lockfile
- uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run cargo test
run: cargo test
Expand All @@ -44,6 +55,14 @@ jobs:
- name: Install Rust
uses: oxidecomputer/actions-rs_toolchain@oxide/master
- uses: Swatinem/rust-cache@v1
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Dependencies
run: npm install -g pnpm@7 && pnpm i --frozen-lockfile
- uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run cargo-tarpaulin
uses: actions-rs/[email protected]
Expand Down
Loading

0 comments on commit dee4a1d

Please sign in to comment.