Skip to content

Commit

Permalink
✨ Save image in different formats (#40)
Browse files Browse the repository at this point in the history
* ♻️ Create constants for common versions

* ✨ Extract: detect endian from file header

* 🔖 Bump cli version to 2.0.0-beta.4

* 🚨 Fix lint

* 👷 Update checkout action to v4

* 👷 Stable version of rust is allowed now

* 👷 Add nasm for CI build

* 👷 Use cargo-binstall to improve CI check speed

* 💚 Fix CI

* 👷 Split CI build scripts
  • Loading branch information
nicks96432 authored Jan 8, 2024
1 parent e48e7e5 commit 8b090fd
Show file tree
Hide file tree
Showing 24 changed files with 1,391 additions and 603 deletions.
22 changes: 6 additions & 16 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,17 @@ jobs:
os: [macos-latest, ubuntu-latest, windows-latest]

steps:
- name: Check out
uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
uses: dtolnay/rust-toolchain@stable

- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install nasm
uses: ilammy/setup-nasm@v1

- uses: Swatinem/rust-cache@v2

- name: Build
run: |
Expand Down
43 changes: 12 additions & 31 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,53 +8,34 @@ env:
CARGO_TERM_COLOR: always

jobs:
check:
lint:
name: Check
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
runs-on: ubuntu-latest

steps:
- name: Check out
uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy

- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Lint
run: |
cargo fmt --all -- --check
cargo clippy -- -D warnings
- name: Install nasm
uses: ilammy/setup-nasm@v1

- uses: Swatinem/rust-cache@v2

- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@main

- name: Install cargo check tools
run: cargo install cargo-deny cargo-outdated cargo-udeps cargo-audit cargo-pants || true
run: cargo binstall --no-confirm cargo-deny cargo-outdated cargo-udeps cargo-audit || true

# remove advisory-db is required to fetch it correctly
- name: Check
run: |
cargo deny check
cargo outdated --exit-code 1
cargo udeps
rm -rf ~/.cargo/advisory-db
cargo audit
cargo pants
- name: Test
run: cargo test
33 changes: 33 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Lint

on:
pull_request:
branches: ["main"]

env:
CARGO_TERM_COLOR: always

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- name: Install nasm
uses: ilammy/setup-nasm@v1

- uses: Swatinem/rust-cache@v2

- name: Lint
run: |
cargo fmt --all -- --check
cargo clippy -- -D warnings
29 changes: 29 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test

on:
pull_request:
branches: ["main"]

env:
CARGO_TERM_COLOR: always

jobs:
test:
name: Check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Install nasm
uses: ilammy/setup-nasm@v1

- uses: Swatinem/rust-cache@v2

- name: Test
run: cargo test
Loading

0 comments on commit 8b090fd

Please sign in to comment.