Skip to content
This repository has been archived by the owner on Oct 28, 2023. It is now read-only.

Commit

Permalink
Update (#161)
Browse files Browse the repository at this point in the history
* Move Session/Builder to their own file

* Address clippy lint

* Update dependencies

* Ignore itertools duplicate

* Cleanup CI

* Add publishing for aarch64-apple-darwin

* Add sample masks example to README

* Update CHANGELOG
  • Loading branch information
Jake-Shadle authored Mar 26, 2021
1 parent 6ae4ca0 commit 3a38812
Show file tree
Hide file tree
Showing 13 changed files with 950 additions and 1,009 deletions.
146 changes: 44 additions & 102 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
on: [push, pull_request]
on:
push:
branches:
- main
tags:
- "*"
pull_request:

name: CI
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand All @@ -14,149 +21,79 @@ jobs:
# make sure all code has been formatted with rustfmt
- run: rustup component add rustfmt
- name: check rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check --color always
run: cargo fmt -- --check --color always

# run clippy to verify we have no warnings
- run: cargo fetch
- run: rustup component add clippy
- name: cargo fetch
uses: actions-rs/cargo@v1
with:
command: fetch
- name: cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --lib --tests -- -D warnings
run: cargo clippy --all-targets -- -D warnings

test:
name: Test
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
os: [ubuntu-20.04, windows-latest, macOS-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: cargo fetch
uses: actions-rs/cargo@v1
with:
command: fetch
- run: cargo fetch
- name: cargo test build
uses: actions-rs/cargo@v1
with:
command: build
args: --tests --release --all-features
run: cargo build --tests --release --all-features
- name: cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --release --all-features
run: cargo test --release --all-features

build:
name: Build WASM
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-wasi
override: true
- name: cargo fetch
uses: actions-rs/cargo@v1
with:
command: fetch
- run: cargo fetch
- name: cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --all --target wasm32-wasi
run: cargo build --target wasm32-wasi

deny-check:
name: cargo-deny
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: EmbarkStudios/cargo-deny-action@v1

publish-check:
name: Publish Check
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: cargo fetch
uses: actions-rs/cargo@v1
with:
command: fetch
- run: cargo fetch
- name: copy README
shell: bash
run: |
cp README.md lib
cp README.md cli
- name: cargo publish lib
uses: actions-rs/cargo@v1
with:
command: publish
args: --dry-run --allow-dirty --manifest-path lib/Cargo.toml

publish:
name: Publish
needs: [test, deny-check, publish-check]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: cargo fetch
uses: actions-rs/cargo@v1
with:
command: fetch
- name: copy README
shell: bash
run: |
cp README.md lib
cp README.md cli
# - name: cargo publish lib
# uses: actions-rs/cargo@v1
# env:
# CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
# with:
# command: publish
# args: --allow-dirty --manifest-path lib/Cargo.toml
# - name: cargo fetch
# uses: actions-rs/cargo@v1
# with:
# command: fetch
- name: cargo publish cli
uses: actions-rs/cargo@v1
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
with:
command: publish
args: --allow-dirty --manifest-path cli/Cargo.toml
run: cargo publish --dry-run --allow-dirty --manifest-path lib/Cargo.toml

release:
name: Release
needs: [test, deny-check]
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
include:
- os: ubuntu-latest
- os: ubuntu-20.04
rust: stable
target: x86_64-unknown-linux-musl
bin: texture-synthesis
Expand All @@ -173,6 +110,11 @@ jobs:
target: x86_64-apple-darwin
bin: texture-synthesis
features: --features=progress
- os: macOS-latest
rust: stable
target: aarch64-apple-darwin
bin: texture-synthesis
features: --features=progress
runs-on: ${{ matrix.os }}
steps:
- name: Install stable toolchain
Expand All @@ -182,21 +124,21 @@ jobs:
override: true
target: ${{ matrix.target }}
- name: Install build deps
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get install -y musl-tools
- name: Workaround xcode shenanigans
if: matrix.target == 'aarch64-apple-darwin'
# https://github.com/actions/virtual-environments/issues/2557#issuecomment-769611326
run: |
sudo xcode-select -s "/Applications/Xcode_12.3.app"
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: cargo fetch
uses: actions-rs/cargo@v1
with:
command: fetch
args: --target ${{ matrix.target }}
run: cargo fetch --target ${{ matrix.target }}
- name: Release build
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path cli/Cargo.toml --release --target ${{ matrix.target }} ${{ matrix.features }}
run: cargo build --manifest-path cli/Cargo.toml --release --target ${{ matrix.target }} ${{ matrix.features }}
- name: Package
shell: bash
run: |
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Updated dependencies

## [0.8.1] - 2020-11-17
### Added
- [PR#154](https://github.com/EmbarkStudios/texture-synthesis/pull/154) added progress notification is now supported when compiling for `wasm32`, thanks [@bnjbvr](https://github.com/bnjbvr)!

## [0.8.0] - 2020-02-26
### Added
- Added the [09_sample_masks](lib/examples/09_sample_masks.rs) example
Expand Down
Loading

0 comments on commit 3a38812

Please sign in to comment.