Skip to content

Commit

Permalink
switch to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
magiclen committed Apr 21, 2021
1 parent 9a3ca24 commit cd66e6d
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 48 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/ci-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI-version

on:
push:
tags:
- "v*"

env:
CARGO_TERM_COLOR: always

jobs:
tests:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
toolchain:
- stable
- nightly
name: Test ${{ matrix.toolchain }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Install libwebp (Linux)
run: |
sudo apt update
sudo apt install libwebp-dev
if: runner.os == 'Linux'
- name: Install libwebp (macOS)
run: |
brew update
brew list webp || brew install webp
if: runner.os == 'macOS'
- name: Install ImageMagick
run: |
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
tar xf ImageMagick.tar.gz
mkdir /tmp/ImageMagick-lib
cd ImageMagick-*
./configure --enable-hdri --with-webp
make
sudo make install
- run: sudo ldconfig
if: runner.os == 'Linux'
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
- run: cargo build --release
- run: cargo test --release
- run: cargo doc --release
86 changes: 86 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: CI

on: [ push, pull_request ]

env:
CARGO_TERM_COLOR: always

jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt
- run: cargo fmt -- --check

clippy:
runs-on: ubuntu-latest
steps:
- name: Install ImageMagick
run: |
sudo apt update
sudo apt install libwebp-dev
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
tar xf ImageMagick.tar.gz
mkdir /tmp/ImageMagick-lib
cd ImageMagick-*
./configure --enable-hdri --with-webp
make
sudo make install
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: clippy
- run: cargo clippy -- -D warnings

tests:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
toolchain:
- stable
- nightly
name: Test ${{ matrix.toolchain }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Install libwebp (Linux)
run: |
sudo apt update
sudo apt install libwebp-dev
if: runner.os == 'Linux'
- name: Install libwebp (macOS)
run: |
brew update
brew list webp || brew install webp
if: runner.os == 'macOS'
- name: Install ImageMagick
run: |
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
tar xf ImageMagick.tar.gz
mkdir /tmp/ImageMagick-lib
cd ImageMagick-*
./configure --enable-hdri --with-webp
make
sudo make install
- run: sudo ldconfig
if: runner.os == 'Linux'
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
- run: cargo build
- run: cargo test
- run: cargo doc
42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

6 changes: 1 addition & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "image-resizer"
version = "0.2.8"
version = "0.2.9"
authors = ["Magic Len <len@magiclen.org>"]
edition = "2018"
repository = "https://github.com/magiclen/image-resizer"
Expand All @@ -12,10 +12,6 @@ readme = "README.md"
license = "MIT"
include = ["src/**/*", "Cargo.toml", "README.md", "LICENSE"]

[badges.travis-ci]
repository = "magiclen/image-resizer"
branch = "master"

[profile.release]
lto = true
codegen-units = 1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Image Resizer
====================

[![Build Status](https://travis-ci.org/magiclen/image-resizer.svg?branch=master)](https://travis-ci.org/magiclen/image-resizer)
[![CI](https://github.com/magiclen/image-resizer/actions/workflows/ci.yml/badge.svg)](https://github.com/magiclen/image-resizer/actions/workflows/ci.yml)

Resize or just shrink images and sharpen them appropriately.

Expand Down

0 comments on commit cd66e6d

Please sign in to comment.