Skip to content

Merge pull request #140 from wasmerio/allow-period-in-package-name #435

Merge pull request #140 from wasmerio/allow-period-in-package-name

Merge pull request #140 from wasmerio/allow-period-in-package-name #435

Workflow file for this run

name: Continuous Integration
on:
pull_request:
push:
branches:
- master
env:
DEFAULT_CRATE_NAME: wasmer_pack
RUST_BACKTRACE: 1
CARGO_NET_GIT_FETCH_WITH_CLI: true
MDBOOK_VERSION: v0.4.21
RUST_LOG: info
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: Compile and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Non-Rust Cache
uses: actions/cache@v3
with:
path: |
**/generated_bindings/
**/node_modules/
key: non-rust-cache
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: "1.2.2"
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Pipenv
run: pip install --user pipenv
- name: Setup Wasmer
uses: wasmerio/setup-wasmer@v1
- name: Install cargo-wasmer
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-wasmer --verbose --debug --version '^0.4' --locked
- name: Type Checking
uses: actions-rs/cargo@v1
with:
command: check
args: --workspace --verbose --locked
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --workspace --verbose --locked
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --verbose --locked
workflow-times:
name: Workflow Timings
runs-on: ubuntu-latest
needs: check
steps:
- name: Time Reporter
uses: Michael-F-Bryan/workflow-timer@v0.2.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
jobs: |
Compile and Test
message: |
Make sure you keep an eye on build times!
One of this project's goals is to [keep CI runs under 5 minutes][goal] so developers can maintain fast edit-compile-test cycles.
[goal]: https://github.com/wasmerio/wasmer-pack/blob/bdfd5c9483821651cf0bbd70189fc04416bc22b1/CONTRIBUTING.md#goal-1-fast-compile-times
lints:
name: Linting and Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Check Formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --verbose --check
- name: Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --verbose
api-docs:
name: Publish API Docs to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install mdbook
run: |
mkdir bin
curl -sSL "https://github.com/rust-lang/mdBook/releases/download/${{ env.MDBOOK_VERSION }}/mdbook-${{ env.MDBOOK_VERSION }}-x86_64-unknown-linux-gnu.tar.gz" | tar -xz --directory=bin
echo "PATH=$(pwd)/bin:$PATH" >> $GITHUB_ENV
- name: User Docs
run: mdbook build
working-directory: doc
- name: API Docs
uses: actions-rs/cargo@v1
with:
command: doc
args: --workspace --verbose --locked
- name: Redirect top-level GitHub Pages
run: 'echo ''<meta http-equiv="refresh" content="0; url=${{ env.DEFAULT_CRATE_NAME }}/index.html" />'' > target/doc/index.html'
shell: bash
- name: Rearrange Docs Directory
run: |
mkdir public
mv target/doc public/api-docs
mv doc/book/html public/user-docs
- name: Upload API Docs
uses: JamesIves/github-pages-deploy-action@v4.4.0
if: github.ref == 'refs/heads/master'
with:
branch: gh-pages
folder: public
single-commit: true