Add Permissionless Asset Registry Feature #2483
Workflow file for this run
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
name: Run Linters | |
on: | |
pull_request: | |
branches: [manta] | |
push: | |
branches: [manta] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
AWS_REGION: us-east-1 | |
AWS_INSTANCE_TYPE: c5.4xlarge | |
AWS_INSTANCE_ROOT_VOLUME_SIZE: 32 | |
AWS_IMAGE_SEARCH_PATTERN: ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-* | |
AWS_IMAGE_SEARCH_OWNERS: '["099720109477"]' | |
jobs: | |
start-checks: | |
timeout-minutes: 120 | |
runs-on: ubuntu-20.04 | |
outputs: | |
runner-label: ${{ steps.start-self-hosted-runner.outputs.runner-label }} | |
aws-region: ${{ steps.start-self-hosted-runner.outputs.aws-region }} | |
aws-instance-id: ${{ steps.start-self-hosted-runner.outputs.aws-instance-id }} | |
steps: | |
- id: start-self-hosted-runner | |
uses: audacious-network/[email protected] | |
with: | |
mode: start | |
github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ env.AWS_REGION }} | |
aws-instance-type: ${{ env.AWS_INSTANCE_TYPE }} | |
aws-instance-root-volume-size: ${{ env.AWS_INSTANCE_ROOT_VOLUME_SIZE }} | |
aws-image-search-pattern: ${{ env.AWS_IMAGE_SEARCH_PATTERN }} | |
aws-image-search-owners: ${{ env.AWS_IMAGE_SEARCH_OWNERS }} | |
- uses: actions/checkout@v2 | |
- name: Run yamllint | |
uses: actionshub/[email protected] | |
- name: install sccache | |
env: | |
SCCACHE_RELEASE_URL: https://github.com/mozilla/sccache/releases/download | |
SCCACHE_VERSION: v0.5.3 | |
run: | | |
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl | |
mkdir -p $HOME/.local/bin | |
curl -L "$SCCACHE_RELEASE_URL/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz | |
mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache | |
chmod +x $HOME/.local/bin/sccache | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
- name: cache cargo registry | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
key: cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
cargo- | |
- name: cache sccache | |
uses: actions/cache@v2 | |
continue-on-error: false | |
with: | |
path: /home/runner/.cache/sccache | |
key: sccache-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
sccache- | |
- name: start sccache server | |
run: sccache --start-server | |
- name: init rust toolchain | |
# NOTE: We use nightly Rust only to get nightly fmt & clippy | |
# TODO: use nightly after https://github.com/clap-rs/clap/issues/4733 fixed. | |
run: | | |
sudo apt update | |
sudo apt install -y pkg-config libssl-dev protobuf-compiler | |
protoc --version | |
curl -s https://sh.rustup.rs -sSf | sh -s -- -y | |
source ${HOME}/.cargo/env | |
rustup toolchain install nightly-2023-03-13 | |
rustup default nightly-2023-03-13 | |
cargo install taplo-cli | |
- name: Check Formatting | |
env: | |
RUST_BACKTRACE: full | |
RUSTC_WRAPPER: sccache | |
SCCACHE_CACHE_SIZE: 2G | |
SCCACHE_DIR: /home/runner/.cache/sccache | |
run: | | |
source ${HOME}/.cargo/env | |
cargo fmt --all -- --check | |
$HOME/.cargo/bin/taplo fmt --check | |
$HOME/.cargo/bin/taplo lint | |
- name: Cargo Check & Clippy | |
env: | |
RUST_BACKTRACE: full | |
RUSTC_WRAPPER: sccache | |
SCCACHE_CACHE_SIZE: 2G | |
SCCACHE_DIR: /home/runner/.cache/sccache | |
run: | | |
source ${HOME}/.cargo/env | |
SKIP_WASM_BUILD=1 cargo check --no-default-features | |
SKIP_WASM_BUILD=1 cargo clippy --all-targets --all-features -- -D warnings | |
- name: stop sccache server | |
run: sccache --stop-server || true | |
stop-checks: | |
needs: start-checks | |
runs-on: ubuntu-20.04 | |
if: ${{ always() }} | |
steps: | |
- continue-on-error: true | |
uses: audacious-network/[email protected] | |
with: | |
mode: stop | |
github-token: ${{ secrets.SELF_HOSTED_RUNNER_TOKEN }} | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ needs.start-checks.outputs.aws-region }} | |
runner-label: ${{ needs.start-checks.outputs.runner-label }} | |
aws-instance-id: ${{ needs.start-checks.outputs.aws-instance-id }} | |
- name: discard stopper success/failure | |
run: true |