Unplug #320
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: Unplug | |
on: | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- '.gitignore' | |
- '**.md' | |
- '**.txt' | |
- 'docs/**' | |
- '.vscode/**' | |
workflow_dispatch: | |
schedule: | |
- cron: '0 8 * * *' | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
name: "Build" | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: windows-x64 | |
host: windows-latest | |
target: x86_64-pc-windows-msvc | |
exe-name: unplug.exe | |
- name: macos-arm64 | |
host: macos-latest | |
target: aarch64-apple-darwin | |
exe-name: unplug | |
- name: macos-x64 | |
host: macos-latest | |
target: x86_64-apple-darwin | |
exe-name: unplug | |
- name: linux-x64 | |
host: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
exe-name: unplug | |
runs-on: ${{ matrix.host }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Toolchain | |
uses: ./.github/actions/toolchain | |
with: | |
target: ${{ matrix.target }} | |
- name: Check | |
run: cargo check --workspace --all-targets --target ${{ matrix.target }} | |
- name: Build CLI | |
run: cargo build -v -p unplug-cli --target ${{ matrix.target }} --release --no-default-features --features distribution | |
env: | |
RUSTFLAGS: -C strip=symbols | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: unplug-${{ github.ref_name }}-${{ matrix.name }} | |
path: | |
target/${{ matrix.target }}/release/${{ matrix.exe-name }} | |
if-no-files-found: error | |
test: | |
name: "Test" | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: windows-x64 | |
host: windows-latest | |
target: x86_64-pc-windows-msvc | |
- name: macos-x64 | |
host: macos-latest | |
target: x86_64-apple-darwin | |
- name: linux-x64 | |
host: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
runs-on: ${{ matrix.host }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Toolchain | |
uses: ./.github/actions/toolchain | |
with: | |
target: ${{ matrix.target }} | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- if: ${{ contains(matrix.host, 'windows') }} | |
name: Download Test Resources (Windows) | |
run: | | |
Start-BitsTransfer -Source "$Env:ISO_URL" -Destination chibi.zip 2>$null | |
Start-BitsTransfer -Source "$Env:BRSAR_URL" -Destination cb_robo.brsar 2>$null | |
Expand-Archive chibi.zip -DestinationPath . | |
Remove-Item chibi.zip | |
env: | |
ISO_URL: ${{ secrets.iso_url }} | |
BRSAR_URL: ${{ secrets.brsar_url }} | |
- if: ${{ !contains(matrix.host, 'windows') }} | |
name: Download Test Resources (Unix) | |
run: | | |
curl -fsS "$ISO_URL" -o chibi.zip | |
curl -fsS "$BRSAR_URL" -o cb_robo.brsar | |
unzip chibi.zip | |
rm chibi.zip | |
env: | |
ISO_URL: ${{ secrets.iso_url }} | |
BRSAR_URL: ${{ secrets.brsar_url }} | |
- name: Build and Run Tests | |
run: cargo llvm-cov -vv --workspace --target ${{ matrix.target }} --lcov --output-path lcov.info | |
env: | |
CHIBI_ISO: ${{ github.workspace }}/chibi.iso | |
CHIBI_BRSAR: ${{ github.workspace }}/cb_robo.brsar | |
- name: Upload Code Coverage | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.github_token }} | |
flag-name: run-${{ matrix.name }} | |
path-to-lcov: lcov.info | |
parallel: true | |
test-done: | |
name: "Test (Finalize)" | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Finalize Coverage | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.github_token }} | |
parallel-finished: true | |
vscode-package: | |
name: "VSCode Package" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install vsce | |
run: npm install --global @vscode/vsce | |
- name: Create VSIX | |
run: | | |
cp ../COPYING LICENSE.txt | |
vsce package --allow-missing-repository -o ../unplug-vscode.vsix | |
working-directory: unplug-vscode | |
- name: Upload | |
uses: actions/upload-artifact@v3 | |
with: | |
name: unplug-vscode | |
path: unplug-vscode.vsix |