ci #128
Workflow file for this run
This file contains hidden or 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: Test | |
| permissions: | |
| contents: write | |
| on: [push] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| rust-test: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-24.04, windows-latest, macos-13, macos-14] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-node@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| components: rustfmt,clippy | |
| rustflags: "-A warnings" | |
| toolchain: "nightly" | |
| - name: Install cargo-binstall | |
| if: matrix.os != 'windows-latest' | |
| shell: sh | |
| run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash | |
| - name: Install cargo-binstall | |
| if: matrix.os == 'windows-latest' | |
| run: Set-ExecutionPolicy Unrestricted -Scope Process; iex (iwr "https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.ps1").Content | |
| shell: powershell | |
| - name: Run | |
| run: | | |
| cargo binstall neofetch -y | |
| neofetch | cargo run --features="cli" -q > ./neofetch.svg | |
| - name: Upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.os }} | |
| path: ./*.svg | |
| npm-test: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: test | |
| run: | | |
| curl --proto '=https' --tlsv1.2 -sSf https://rsproxy.cn/rustup-init.sh | sh -s -- -y --default-toolchain nightly | |
| curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash | |
| rustup target add wasm32-unknown-unknown | |
| cargo binstall wasm-pack -y --force | |
| npm i pnpm -g | |
| cd ./ansi2 | |
| cargo test | |
| cd .. | |
| cd ./ansi2-wasm | |
| pnpm i | |
| pnpm run build | |
| sudo apt-get install neofetch -y | |
| neofetch | node ./bin/cli.js --format=svg --theme=vscode > neofetch.svg | |
| - name: Upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ansi2 | |
| path: ./ansi2-wasm/*.svg |