Skip to content

Commit

Permalink
Update from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
SIMULATAN committed Sep 10, 2023
1 parent 79e3189 commit 1f003a0
Show file tree
Hide file tree
Showing 14 changed files with 866 additions and 737 deletions.
56 changes: 41 additions & 15 deletions .github/workflows/build-for-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,67 @@ on:
types: [published]

jobs:
build-artifact:
build-release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
exe_suffix: ""
name_suffix: ""
target: x86_64-unknown-linux-musl
- os: macos-latest
exe_suffix: ""
name_suffix: ".arm"
target: aarch64-apple-darwin
- os: windows-latest
exe_suffix: ".exe"
name_suffix: ".exe"
target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.target }}
override: true
- uses: actions/checkout@v3
- name: Update rust
run: rustup update
- name: Add target
run: rustup target add ${{ matrix.target }}
- name: Cache dependencies
uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --locked --verbose --target ${{ matrix.target }}
uses: Swatinem/rust-cache@v2
- name: Build
run: "cargo build --release --locked --verbose --target ${{ matrix.target }}"
- name: Upload asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_path: target/${{ matrix.target }}/release/dotter${{ matrix.exe_suffix }}
asset_name: dotter${{ matrix.exe_suffix }}
asset_name: dotter${{ matrix.name_suffix }}
asset_content_type: application/octet-stream
upload_url: ${{ github.event.release.upload_url }}
build-completions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Update rust
run: rustup update
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Generate Completions
run: |
cargo build
SHELLS="bash elvish fish powershell zsh"
mkdir completions
for shell in $SHELLS; do
cargo run -- gen-completions --shell $shell --to completions
done
zip -r completions.zip completions
- name: Upload Assets
uses: softprops/action-gh-release@v1
with:
files: completions.zip
cargo-publish:
runs-on: ubuntu-latest
steps:
Expand Down
111 changes: 51 additions & 60 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
on: [push, pull_request]
on:
push:
branches: [ master ]
pull_request:

name: Continuous integration

Expand All @@ -8,93 +11,81 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
build_name: [windows, ubuntu, macos-x86, macos-aarch64]
include:
- os: windows-latest
- build_name: windows
os: windows-latest
target: x86_64-pc-windows-msvc
- os: ubuntu-latest
- build_name: ubuntu
os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: macos-latest
- build_name: macos-x86
os: macos-latest
target: x86_64-apple-darwin
- build_name: macos-aarch64
os: macos-latest
target: aarch64-apple-darwin
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.target }}
override: true
- uses: actions/checkout@v3
- name: Update Rust
run: |
rustup update
rustup target add ${{ matrix.target }}
- name: Cache dependencies
uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: check
args: --verbose --locked --target ${{ matrix.target }}
uses: Swatinem/rust-cache@v2
- run: cargo check --verbose --locked --target ${{ matrix.target }}
check-readme:
name: Check README
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions/checkout@v3
- name: Update Rust
run: rustup update
- name: Cache dependencies
uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --locked
uses: Swatinem/rust-cache@v2
- run: cargo build --verbose --locked
- name: Check README help message
run: "[[ ! $(comm -13 <(sort README.md) <(cargo run --locked -- --help | sort)) ]] || cargo run --locked -- --help | diff - README.md"
check-publish:
name: Check cargo publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Update Rust
run: rustup update
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- run: cargo publish --dry-run --verbose --locked
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions/checkout@v3
- name: Update Rust
run: rustup update
- name: Cache dependencies
uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: test
uses: Swatinem/rust-cache@v2
- run: cargo test
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions/checkout@v3
- name: Update Rust
run: rustup update
- run: rustup component add rustfmt
- name: Cache dependencies
uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions/checkout@v3
- name: Update Rust
run: rustup update
- run: rustup component add clippy
- name: Cache dependencies
uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
uses: Swatinem/rust-cache@v2
- run: cargo clippy -- -D warnings
Loading

0 comments on commit 1f003a0

Please sign in to comment.