Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in CI Workflows #33

Merged
merged 5 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
on:
push:
branches: [stylus]
pull_request:

name: check
jobs:
fmt:
runs-on: ubuntu-latest
name: stable / fmt
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install stable
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: cargo fmt --check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --check
clippy:
runs-on: ubuntu-latest
name: ${{ matrix.toolchain }} / clippy
strategy:
fail-fast: false
matrix:
toolchain: [stable, beta]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install ${{ matrix.toolchain }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy
- name: cargo clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: linux
on:
push:
branches:
- stylus
pull_request:

jobs:
test:
runs-on: ubuntu-latest
name: (${{ matrix.target }}, ${{ matrix.cfg_release_channel }})
env:
CFG_RELEASE_CHANNEL: ${{ matrix.cfg_release_channel }}
strategy:
matrix:
target: [
x86_64-unknown-linux-gnu,
]
cfg_release_channel: [nightly, stable]

steps:
- name: checkout
uses: actions/checkout@v3

# Run build
- name: install rustup
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
sh rustup-init.sh -y --default-toolchain none
rustup target add ${{ matrix.target }}

- name: Build and Test
run: ./ci/build_and_test.sh
34 changes: 34 additions & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: mac
on:
push:
branches:
- stylus
pull_request:

jobs:
test:
runs-on: macos-latest
name: (${{ matrix.target }}, ${{ matrix.cfg_release_channel }})
env:
CFG_RELEASE_CHANNEL: ${{ matrix.cfg_release_channel }}
strategy:
fail-fast: false
matrix:
target: [
aarch64-apple-darwin,
]
cfg_release_channel: [nightly, stable]

steps:
- name: checkout
uses: actions/checkout@v3

# Run build
- name: install rustup
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
sh rustup-init.sh -y --default-toolchain none
rustup target add ${{ matrix.target }}

- name: Build and Test
run: ./ci/build_and_test.sh
18 changes: 18 additions & 0 deletions ci/build_and_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -euo pipefail

export RUSTFLAGS="-D warnings"
export RUSTFMT_CI=1

# Print version information
rustc -Vv
cargo -V

# Build and test main crate
if [ "$CFG_RELEASE_CHANNEL" == "nightly" ]; then
cargo build --locked --all-features
else
cargo build --locked
fi
cargo test --all-features
Loading