Skip to content

Commit

Permalink
Upgrade actions
Browse files Browse the repository at this point in the history
  • Loading branch information
canac committed Mar 20, 2024
1 parent 66332db commit 40b315c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 60 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,9 @@ jobs:
- shell: fish
- shell: zsh
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- uses: actions-rs/cargo@v1
with:
command: install
args: --path .
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo install --path .
- run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
./e2e/setup.sh
Expand Down
29 changes: 16 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
target: aarch64-pc-windows-msvc
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set artifact name
shell: bash
Expand All @@ -44,21 +44,23 @@ jobs:
echo "artifact: $name"
- name: Install Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}

- name: Build binary
uses: actions-rs/cargo@v1
with:
command: build
args: --release --locked --target=${{ matrix.target }} --color=always --verbose
use-cross: ${{ runner.os == 'Linux' }}
- name: Install cross
if: matrix.os == 'ubuntu-latest'
uses: taiki-e/install-action@cross

- name: Build binary [Cross]
if: matrix.os == 'ubuntu-latest'
run: cross build --release --locked --target ${{ matrix.target }} --color=always --verbose

- name: Package (*nix)
- name: Build binary [Cargo]
if: matrix.os != 'ubuntu-latest'
run: cargo build --release --locked --target ${{ matrix.target }} --color=always --verbose

- name: Package [*nix]
if: runner.os != 'Windows'
run: >
tar -cv
Expand All @@ -67,7 +69,8 @@ jobs:
-C contrib/ completions/ -C ../
-C target/${{ matrix.target }}/release/ portman
| gzip --best > '${{ env.ARTIFACT_NAME }}.tar.gz'
- name: Package (Windows)
- name: Package [Windows]
if: runner.os == 'Windows'
run: >
7z a ${{ env.ARTIFACT_NAME }}.zip
Expand Down
51 changes: 13 additions & 38 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,33 @@ jobs:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: check
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo check --all-targets

test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: test
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: cargo test

fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- 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
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
command: clippy
args: --all-targets -- -D warnings
components: clippy
- run: cargo clippy --all-targets -- -D warnings

0 comments on commit 40b315c

Please sign in to comment.