mirror of
https://github.com/fluencelabs/aquavm
synced 2025-03-15 04:30:48 +00:00
chore: Speedup CI (#654)
* Update workflows * Cache when building wasm * F * Fix * Fix * Cleanup * F
This commit is contained in:
parent
372b90496f
commit
4b176c7684
21
.github/workflows/lint-pr.yml
vendored
Normal file
21
.github/workflows/lint-pr.yml
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
name: lint PR
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- edited
|
||||
- synchronize
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
title:
|
||||
name: Validate PR title
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: amannn/action-semantic-pull-request@v5
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
28
.github/workflows/lint.yml
vendored
28
.github/workflows/lint.yml
vendored
@ -2,24 +2,15 @@ name: lint
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- edited
|
||||
- synchronize
|
||||
paths:
|
||||
- ".github/workflows/**"
|
||||
- ".github/renovate.json"
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
pr:
|
||||
name: Validate PR title
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: amannn/action-semantic-pull-request@v5
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
reviewdog:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@ -28,6 +19,19 @@ jobs:
|
||||
|
||||
- name: Lint actions
|
||||
uses: reviewdog/action-actionlint@v1
|
||||
env:
|
||||
SHELLCHECK_OPTS: "-e SC2086 -e SC2207 -e SC2128"
|
||||
with:
|
||||
reporter: github-pr-check
|
||||
fail_on_error: true
|
||||
|
||||
renovate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Renovate Config Validator
|
||||
uses: tj-actions/renovate-config-validator@v2
|
||||
with:
|
||||
config_file: .github/renovate.json
|
||||
|
42
.github/workflows/run-tests.yml
vendored
42
.github/workflows/run-tests.yml
vendored
@ -7,12 +7,6 @@ on:
|
||||
- ".github/**"
|
||||
- "!.github/workflows/run-tests.yml"
|
||||
- "!.github/workflows/tests.yml"
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- ".github/**"
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||
@ -23,3 +17,39 @@ jobs:
|
||||
uses: ./.github/workflows/tests.yml
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
lints:
|
||||
runs-on: builder
|
||||
|
||||
env:
|
||||
RUSTFLAGS: "-D warnings"
|
||||
RUSTC_WRAPPER: "sccache"
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Rust toolchain
|
||||
uses: dsherret/rust-toolchain-file@v1
|
||||
|
||||
- name: Setup cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
cache-directories: ~/.cache/sccache
|
||||
shared-key: aquavm
|
||||
save-if: false
|
||||
|
||||
- name: Setup sccache
|
||||
uses: mozilla-actions/sccache-action@v0.0.3
|
||||
|
||||
- name: Run cargo check
|
||||
run: cargo check
|
||||
|
||||
- name: Run cargo clippy
|
||||
uses: giraffate/clippy-action@v1
|
||||
with:
|
||||
reporter: github-pr-review
|
||||
fail_on_error: true
|
||||
|
||||
- name: Run cargo fmt
|
||||
uses: actions-rust-lang/rustfmt@v1
|
||||
|
14
.github/workflows/snapshot-air-beautify-wasm.yml
vendored
14
.github/workflows/snapshot-air-beautify-wasm.yml
vendored
@ -14,6 +14,8 @@ on:
|
||||
|
||||
env:
|
||||
FORCE_COLOR: true
|
||||
RUSTFLAGS: "-D warnings"
|
||||
RUSTC_WRAPPER: "sccache"
|
||||
|
||||
jobs:
|
||||
snapshot:
|
||||
@ -49,7 +51,17 @@ jobs:
|
||||
kv/npm-registry/basicauth/ci token | NODE_AUTH_TOKEN
|
||||
|
||||
- name: Setup Rust toolchain
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
uses: dsherret/rust-toolchain-file@v1
|
||||
|
||||
- name: Setup cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
cache-directories: ~/.cache/sccache
|
||||
shared-key: aquavm
|
||||
save-if: false
|
||||
|
||||
- name: Setup sccache
|
||||
uses: mozilla-actions/sccache-action@v0.0.3
|
||||
|
||||
- name: Setup wasm-pack
|
||||
uses: jetli/wasm-pack-action@v0.4.0
|
||||
|
@ -18,6 +18,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
|
||||
env:
|
||||
RUSTFLAGS: "-D warnings"
|
||||
RUSTC_WRAPPER: "sccache"
|
||||
|
||||
steps:
|
||||
- name: Checkout AquaVM
|
||||
uses: actions/checkout@v3
|
||||
@ -26,7 +30,20 @@ jobs:
|
||||
ref: ${{ inputs.ref }}
|
||||
|
||||
- name: Setup Rust toolchain
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
uses: dsherret/rust-toolchain-file@v1
|
||||
|
||||
- name: Setup cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
cache-directories: ~/.cache/sccache
|
||||
shared-key: aquavm
|
||||
# github allows only 10GB of cache
|
||||
# so save cache only on merge to master
|
||||
# to use less space and speed up CI
|
||||
save-if: ${{ github.event_name == 'push' }}
|
||||
|
||||
- name: Setup sccache
|
||||
uses: mozilla-actions/sccache-action@v0.0.3
|
||||
|
||||
- name: Download marine artifact
|
||||
id: marine
|
||||
|
16
.github/workflows/snapshot-cargo.yml
vendored
16
.github/workflows/snapshot-cargo.yml
vendored
@ -22,6 +22,10 @@ jobs:
|
||||
runs-on: builder
|
||||
timeout-minutes: 60
|
||||
|
||||
env:
|
||||
RUSTFLAGS: "-D warnings"
|
||||
RUSTC_WRAPPER: "sccache"
|
||||
|
||||
outputs:
|
||||
version: "${{ steps.snapshot.outputs.version }}"
|
||||
|
||||
@ -50,7 +54,17 @@ jobs:
|
||||
kv/cargo-registry/users/ci token | CARGO_REGISTRIES_FLUENCE_TOKEN
|
||||
|
||||
- name: Setup Rust toolchain
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
uses: dsherret/rust-toolchain-file@v1
|
||||
|
||||
- name: Setup cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
cache-directories: ~/.cache/sccache
|
||||
shared-key: aquavm
|
||||
save-if: false
|
||||
|
||||
- name: Setup sccache
|
||||
uses: mozilla-actions/sccache-action@v0.0.3
|
||||
|
||||
- name: Set dependencies
|
||||
if: inputs.cargo-dependencies != 'null'
|
||||
|
46
.github/workflows/snapshot.yml
vendored
46
.github/workflows/snapshot.yml
vendored
@ -1,46 +0,0 @@
|
||||
# Compatibility workflow to call from not updated E2E from other repos
|
||||
name: Publish snapshots
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
ref:
|
||||
description: "git ref to checkout to"
|
||||
type: string
|
||||
default: "master"
|
||||
cargo-dependencies:
|
||||
description: "Cargo dependencies map"
|
||||
type: string
|
||||
outputs:
|
||||
cargo-version:
|
||||
description: "Cargo snapshot version"
|
||||
value: ${{ jobs.cargo-snapshot.outputs.version }}
|
||||
avm-version:
|
||||
description: "@fluencelabs/avm version"
|
||||
value: ${{ jobs.publish-avm.outputs.version }}
|
||||
air-beautify-wasm-version:
|
||||
description: "air-beautify-wasm version"
|
||||
value: ${{ jobs.publish-beautify.outputs.version }}
|
||||
|
||||
jobs:
|
||||
wasm:
|
||||
uses: ./.github/workflows/snapshot-air-interpreter-wasm.yml
|
||||
with:
|
||||
ref: ${{ inputs.ref }}
|
||||
|
||||
cargo-snapshot:
|
||||
needs: wasm
|
||||
uses: ./.github/workflows/snapshot-cargo.yml
|
||||
with:
|
||||
ref: ${{ inputs.ref }}
|
||||
|
||||
publish-avm:
|
||||
needs: wasm
|
||||
uses: ./.github/workflows/snapshot-avm.yml
|
||||
with:
|
||||
ref: ${{ inputs.ref }}
|
||||
|
||||
publish-air-beautify:
|
||||
uses: ./.github/workflows/snapshot-air-beautify-wasm.yml
|
||||
with:
|
||||
ref: ${{ inputs.ref }}
|
13
.github/workflows/tests.yml
vendored
13
.github/workflows/tests.yml
vendored
@ -28,8 +28,8 @@ jobs:
|
||||
repository: fluencelabs/aquavm
|
||||
ref: ${{ inputs.ref }}
|
||||
|
||||
- name: Setup rust toolchain
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
- name: Setup Rust toolchain
|
||||
uses: dsherret/rust-toolchain-file@v1
|
||||
|
||||
- name: Download marine artifact
|
||||
id: marine
|
||||
@ -98,14 +98,5 @@ jobs:
|
||||
RUSTFLAGS="$RUSTFLAGS -Z sanitizer=$san" cargo test --features test_with_native_code --target x86_64-unknown-linux-gnu
|
||||
done
|
||||
|
||||
- name: Run cargo fmt
|
||||
run: cargo fmt --all -- --check
|
||||
|
||||
- name: Run cargo check
|
||||
run: cargo check
|
||||
|
||||
- name: Check native aquavm-air-cli
|
||||
run: cargo check --package aquavm-air-cli --no-default-features
|
||||
|
||||
- name: Run cargo clippy
|
||||
run: cargo clippy -v
|
||||
|
Loading…
x
Reference in New Issue
Block a user