-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from OffchainLabs/add-ci
Add in CI Workflows
- Loading branch information
Showing
4 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |