Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
canac committed Apr 12, 2024
1 parent 4f9037c commit 9d4392c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-shuttle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: printf "'AUTH_TOKEN' = '${{ secrets.AUTH_TOKEN }}'\n'DATABASE_URL' = '${{ secrets.DATABASE_URL }}'\n" http_server > http_server/Secrets.toml
- name: Install cargo-shuttle
run: |
Expand Down
31 changes: 17 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,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 @@ -46,21 +46,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 --bin=mailbox --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 @@ -69,7 +71,8 @@ jobs:
-C cli/contrib/ completions/ -C ../../
-C target/${{ matrix.target }}/release/ mailbox
| 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 Expand Up @@ -98,7 +101,7 @@ jobs:
runs-on: ubuntu-latest
needs: release
steps:
- uses: mislav/bump-homebrew-formula-action@v1.16
- uses: mislav/bump-homebrew-formula-action@v3
with:
formula-name: mailbox
homebrew-tap: canac/homebrew-tap
Expand Down
56 changes: 14 additions & 42 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,9 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-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 (${{ matrix.os }})
Expand All @@ -28,48 +22,26 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: ikalnytskyi/action-setup-postgres@v5
id: postgres
- uses: actions-rs/cargo@v1
with:
command: test
env:
TEST_DB_URL: ${{ steps.postgres.outputs.connection-uri }}
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: 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
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
command: fmt
args: --all -- --check
components: rustfmt
- 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 -- --deny warnings

0 comments on commit 9d4392c

Please sign in to comment.