chore: release 0.10.0 (#652) #2120
This file contains hidden or 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
name: ci | |
permissions: | |
contents: read | |
packages: read | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
env: | |
CARGO_TERM_COLOR: always | |
GITHUB_ACTOR: pop-cli | |
CARGO_INCREMENTAL: 1 | |
RUST_BACKTRACE: 1 | |
# It is important to always use the same flags. Otherwise, the cache will not work. | |
RUSTFLAGS: "-Dwarnings" | |
RUSTDOCFLAGS: "-Dwarnings" | |
concurrency: | |
# Cancel any in-progress jobs for the same pull request or branch | |
group: ci-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
image: ${{ steps.out.outputs.image }} | |
rust_version: ${{ steps.out.outputs.rust_version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set environment variables | |
id: out | |
env: | |
HASH: ${{ hashFiles('Dockerfile.ci') }} | |
run: | | |
set -xeuo pipefail | |
RUST_VERSION=$(yq -r '.toolchain.channel' rust-toolchain.toml) | |
echo "rust_version=$RUST_VERSION" >> "$GITHUB_OUTPUT" | |
echo "image=ghcr.io/${GITHUB_REPOSITORY,,}:${RUST_VERSION}-${HASH}" >> "$GITHUB_OUTPUT" | |
prepare-ci-image: | |
needs: | |
- setup | |
uses: ./.github/workflows/docker-ci.yml | |
permissions: | |
contents: read | |
packages: write | |
with: | |
docker_image: ${{ needs.setup.outputs.image }} | |
rust_version: ${{ needs.setup.outputs.rust_version }} | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust nightly | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
profile: minimal | |
components: rustfmt | |
override: true | |
- name: Check formatting | |
run: cargo +nightly fmt --all -- --check | |
build: | |
needs: | |
- setup | |
- lint | |
- prepare-ci-image | |
runs-on: ubuntu-latest | |
container: | |
image: ${{ needs.setup.outputs.image }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-all-crates: true | |
shared-key: shared-${{ github.head_ref || github.ref_name }} | |
- name: Check no default features | |
run: cargo check --no-default-features | |
- name: Check contracts feature | |
run: cargo check --no-default-features --features contract | |
- name: Check polkavm-contracts feature | |
run: cargo check --no-default-features --features "polkavm-contracts, v6" -p pop-cli -p pop-contracts | |
- name: Check chain feature | |
run: cargo check --no-default-features --features chain | |
- name: Check default features | |
run: cargo check | |
clippy: | |
needs: | |
- build | |
- setup | |
runs-on: ubuntu-latest | |
container: | |
image: ${{ needs.setup.outputs.image }} | |
permissions: | |
checks: write | |
packages: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
save-if: false | |
shared-key: shared-${{ github.head_ref || github.ref_name }} | |
- name: Annotate with Clippy warnings | |
uses: actions-rs/clippy-check@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: --all-targets -- -D warnings | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/build-push-action@v5 | |
docs: | |
needs: | |
- setup | |
- build | |
runs-on: ubuntu-latest | |
container: | |
image: ${{ needs.setup.outputs.image }} | |
permissions: | |
checks: write | |
packages: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
save-if: false | |
shared-key: shared-${{ github.head_ref || github.ref_name }} | |
- name: Check no default features | |
run: cargo doc --no-deps | |
env: | |
# We cannot propagate the "mising_docs" flag, as otherwise other tests fail. | |
RUSTFLAGS: "-Dwarnings -Dmissing_docs" | |
polkavm-unit-tests: | |
needs: | |
- setup | |
- build | |
runs-on: ubuntu-latest | |
container: | |
image: ${{ needs.setup.outputs.image }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
save-if: false | |
shared-key: shared-${{ github.head_ref || github.ref_name }} | |
- name: Run unit tests for polkavm-contracts | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: cargo nextest run --lib --bins --no-default-features --features "polkavm-contracts, v6" -p pop-cli -p pop-contracts | |
documentation-tests: | |
needs: | |
- setup | |
- build | |
runs-on: ubuntu-latest | |
container: | |
image: ${{ needs.setup.outputs.image }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
save-if: false | |
shared-key: shared-${{ github.head_ref || github.ref_name }} | |
- name: Run doc tests | |
run: cargo test --doc | |
contract-integration-tests: | |
needs: build | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
default: true | |
target: wasm32-unknown-unknown | |
components: rust-src, clippy | |
- name: Rust Cache Linux | |
if: matrix.os == 'ubuntu-latest' | |
uses: Swatinem/rust-cache@v2 | |
with: | |
save-if: false | |
shared-key: shared-${{ github.head_ref || github.ref_name }} | |
- name: Rust Cache MacOS | |
if: matrix.os == 'macos-latest' | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
cache-all-crates: true | |
shared-key: shared-${{ github.head_ref || github.ref_name }}-macos | |
- name: Install packages (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y protobuf-compiler | |
protoc --version | |
- name: Install packages (macOS) | |
if: matrix.os == 'macos-latest' | |
run: | | |
brew install protobuf | |
protoc --version | |
- name: Install cargo-nextest | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-nextest | |
- name: Run integration tests | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: cargo nextest run --no-default-features --features "contract,integration-tests" --test contract | |
chain-integration-tests: | |
needs: build | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
default: true | |
target: wasm32-unknown-unknown | |
components: rust-src | |
- name: Rust Cache Linux | |
if: matrix.os == 'ubuntu-latest' | |
uses: Swatinem/rust-cache@v2 | |
with: | |
save-if: false | |
shared-key: shared-${{ github.head_ref || github.ref_name }} | |
- name: Rust Cache MacOS | |
if: matrix.os == 'macos-latest' | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
cache-all-crates: true | |
shared-key: shared-${{ github.head_ref || github.ref_name }}-macos | |
- name: Install packages (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y protobuf-compiler | |
protoc --version | |
- name: Install packages (macOS) | |
if: matrix.os == 'macos-latest' | |
run: | | |
brew install protobuf | |
protoc --version | |
- name: Install cargo-nextest | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-nextest | |
- name: Run integration tests | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
cargo nextest run --no-default-features --features "chain,integration-tests" --test chain --test metadata |