fix(explorer): hide unsafe NFT images without filtering items #4753
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: Build Trunk | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - "apps/**" | |
| - "docs/**" | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| - ready_for_review | |
| - converted_to_draft | |
| push: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - "apps/**" | |
| workflow_dispatch: | |
| concurrency: | |
| group: build-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: { } | |
| jobs: | |
| build-linux: | |
| name: Build Acton (${{ matrix.arch }}-${{ matrix.vendor }}-${{ matrix.sys }}-${{ matrix.abi }}) | |
| strategy: &runner_linux_strategy | |
| matrix: | |
| include: | |
| - runner: ubicloud-standard-16-ubuntu-2204 | |
| arch: x86_64 | |
| vendor: unknown | |
| sys: linux | |
| abi: gnu | |
| runs-on: ${{ matrix.runner }} | |
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false | |
| env: | |
| TARGET_NAME: ${{ matrix.arch }}-${{ matrix.vendor }}-${{ matrix.sys }}-${{ matrix.abi }} | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Check out Acton repository | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Check changed paths | |
| id: changes | |
| shell: bash | |
| env: | |
| BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }} | |
| # language=Bash | |
| run: | | |
| set -euo pipefail | |
| packages_only=false | |
| if [[ -n "${BASE_SHA}" ]] && | |
| ! git diff --quiet "${BASE_SHA}" "${GITHUB_SHA}" -- packages/ && | |
| git diff --quiet "${BASE_SHA}" "${GITHUB_SHA}" -- . ':(exclude)packages/**' | |
| then | |
| packages_only=true | |
| fi | |
| echo "packages_only=${packages_only}" >> "${GITHUB_OUTPUT}" | |
| - name: Cache Cargo | |
| uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| with: | |
| key: ${{ runner.os }}-${{ runner.arch }} | |
| save-if: ${{ github.ref == 'refs/heads/master' }} | |
| - name: Install Rust | |
| run: rustup toolchain install | |
| - name: Installing additional Rust components | |
| uses: taiki-e/install-action@15449e3094499af05d8d964a1c884208e4b8b595 # v2.81.11 | |
| with: | |
| tool: just@1.52.0,nextest@0.9.137 | |
| fallback: none | |
| - name: Download TON objects archive | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| # language=Bash | |
| run: | | |
| ARCHIVE_NAME="ton-objs-${TARGET_NAME}.tar.gz" | |
| mkdir -p objs | |
| gh release download release-objs \ | |
| --repo "${GITHUB_REPOSITORY}" \ | |
| --pattern "${ARCHIVE_NAME}" \ | |
| --dir "${RUNNER_TEMP}" | |
| tar -C objs -xzf "${RUNNER_TEMP}/${ARCHIVE_NAME}" | |
| - name: Install LLVM and Clang | |
| timeout-minutes: 5 | |
| # language=Bash | |
| run: | | |
| wget https://apt.llvm.org/llvm.sh | |
| chmod +x llvm.sh | |
| sudo ./llvm.sh 16 clang | |
| rm llvm.sh | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| - name: Restore Bun cache | |
| id: bun-cache | |
| uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: &linux-build-ui-bun-cache-path | | |
| ~/.bun/install/cache | |
| key: ${{ runner.os }}-${{ runner.arch }}-build-ui-${{ hashFiles('bun.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-build-ui- | |
| - name: Restore Playwright cache | |
| id: ui-e2e-playwright-cache | |
| uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: &linux-ui-e2e-playwright-cache-path | | |
| ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-${{ runner.arch }}-playwright-${{ hashFiles('bun.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-playwright- | |
| - name: Build UI | |
| run: just build-ui | |
| - name: Build acton binary | |
| env: | |
| ACTON_RELEASE_CHANNEL: trunk | |
| CC: clang-16 | |
| CXX: clang++-16 | |
| # language=Bash | |
| run: cargo build --release --locked --target "${TARGET_NAME}" --bin acton | |
| - name: Add acton to PATH | |
| run: echo "${GITHUB_WORKSPACE}/target/${TARGET_NAME}/release" >> "$GITHUB_PATH" | |
| - name: Test acton binary | |
| run: | | |
| acton --help | |
| - name: Run Test UI E2E | |
| id: test-ui-e2e | |
| env: | |
| ACTON_E2E_BIN: ${{ github.workspace }}/target/${{ env.TARGET_NAME }}/release/acton | |
| run: just test-ui-e2e-run | |
| - name: Upload Test UI E2E artifacts | |
| if: failure() && steps.test-ui-e2e.outcome == 'failure' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: test-ui-e2e-results | |
| path: test-results/acton-test-ui-e2e | |
| retention-days: 1 | |
| if-no-files-found: ignore | |
| - name: Run Explorer UI E2E | |
| # TODO: Re-enable after fixing Explorer UI E2E. | |
| if: false | |
| id: explorer-ui-e2e | |
| env: | |
| ACTON_E2E_BIN: ${{ github.workspace }}/target/${{ env.TARGET_NAME }}/release/acton | |
| run: just test-explorer-ui-e2e-run | |
| - name: Upload Explorer UI E2E artifacts | |
| if: failure() && steps.explorer-ui-e2e.outcome == 'failure' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: explorer-ui-e2e-results | |
| path: test-results/acton-ui-e2e | |
| retention-days: 1 | |
| if-no-files-found: ignore | |
| - name: Run tests | |
| if: steps.changes.outputs.packages_only != 'true' | |
| run: | | |
| just test | |
| - name: Save Bun cache | |
| if: github.ref == 'refs/heads/master' && steps.bun-cache.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: *linux-build-ui-bun-cache-path | |
| key: ${{ steps.bun-cache.outputs.cache-primary-key }} | |
| - name: Save Playwright cache | |
| if: github.ref == 'refs/heads/master' && steps.ui-e2e-playwright-cache.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: *linux-ui-e2e-playwright-cache-path | |
| key: ${{ steps.ui-e2e-playwright-cache.outputs.cache-primary-key }} | |
| - name: Prepare trunk archive | |
| if: github.ref == 'refs/heads/master' && github.repository == 'ton-blockchain/acton' | |
| run: | | |
| cargo xtask dist archive --target "${TARGET_NAME}" --profile release | |
| - name: Upload trunk archive artifact | |
| if: github.ref == 'refs/heads/master' && github.repository == 'ton-blockchain/acton' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: artifacts-${{ env.TARGET_NAME }} | |
| path: | | |
| acton-${{ env.TARGET_NAME }}.tar.gz | |
| acton-${{ env.TARGET_NAME }}.tar.gz.sha256 | |
| retention-days: 1 | |
| if-no-files-found: error | |
| - name: Check Acton target binary | |
| shell: bash | |
| # language=Bash | |
| run: | | |
| python3 "${GITHUB_WORKSPACE}/.github/scripts/check-rust-target-binary.py" \ | |
| --binary "${GITHUB_WORKSPACE}/target/${TARGET_NAME}/release/acton" \ | |
| --target "${TARGET_NAME}" | |
| lint: | |
| name: Lint Acton (${{ matrix.arch }}-${{ matrix.vendor }}-${{ matrix.sys }}-${{ matrix.abi }}) | |
| strategy: *runner_linux_strategy | |
| runs-on: ${{ matrix.runner }} | |
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false | |
| env: | |
| TARGET_NAME: ${{ matrix.arch }}-${{ matrix.vendor }}-${{ matrix.sys }}-${{ matrix.abi }} | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Check out Acton repository | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Cache Cargo | |
| uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| with: | |
| key: ${{ runner.os }}-${{ runner.arch }} | |
| save-if: ${{ github.ref == 'refs/heads/master' }} | |
| - name: Install Rust | |
| run: rustup toolchain install | |
| - name: Installing additional Rust components | |
| uses: taiki-e/install-action@15449e3094499af05d8d964a1c884208e4b8b595 # v2.81.11 | |
| with: | |
| tool: just@1.52.0,cargo-shear@1.13.1,typos@1.47.2 | |
| fallback: none | |
| - name: Download TON objects archive | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| # language=Bash | |
| run: | | |
| ARCHIVE_NAME="ton-objs-${TARGET_NAME}.tar.gz" | |
| mkdir -p objs | |
| gh release download release-objs \ | |
| --repo "${GITHUB_REPOSITORY}" \ | |
| --pattern "${ARCHIVE_NAME}" \ | |
| --dir "${RUNNER_TEMP}" | |
| tar -C objs -xzf "${RUNNER_TEMP}/${ARCHIVE_NAME}" | |
| - name: Run formatter and linter | |
| run: | | |
| just check-ci | |
| build-macos: | |
| name: Build Acton (${{ matrix.arch }}-${{ matrix.vendor }}-${{ matrix.sys }}) | |
| strategy: &runner_macos_strategy | |
| matrix: | |
| include: | |
| - runner: macos-15 | |
| arch: aarch64 | |
| vendor: apple | |
| sys: darwin | |
| runs-on: ${{ matrix.runner }} | |
| if: github.ref == 'refs/heads/master' && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) | |
| env: | |
| TARGET_NAME: ${{ matrix.arch }}-${{ matrix.vendor }}-${{ matrix.sys }} | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Check out Acton repository | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Check changed paths | |
| id: changes | |
| shell: bash | |
| env: | |
| BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }} | |
| # language=Bash | |
| run: | | |
| set -euo pipefail | |
| packages_only=false | |
| if [[ -n "${BASE_SHA}" ]] && | |
| ! git diff --quiet "${BASE_SHA}" "${GITHUB_SHA}" -- packages/ && | |
| git diff --quiet "${BASE_SHA}" "${GITHUB_SHA}" -- . ':(exclude)packages/**' | |
| then | |
| packages_only=true | |
| fi | |
| echo "packages_only=${packages_only}" >> "${GITHUB_OUTPUT}" | |
| - name: Cache Cargo | |
| uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| with: | |
| key: ${{ runner.os }}-${{ runner.arch }} | |
| save-if: ${{ github.ref == 'refs/heads/master' }} | |
| - name: Install Rust | |
| run: rustup toolchain install | |
| - name: Installing additional Rust components | |
| uses: taiki-e/install-action@15449e3094499af05d8d964a1c884208e4b8b595 # v2.81.11 | |
| with: | |
| tool: just@1.52.0,nextest@0.9.137 | |
| fallback: none | |
| - name: Download TON objects archive | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| # language=Bash | |
| run: | | |
| ARCHIVE_NAME="ton-objs-${TARGET_NAME}.tar.gz" | |
| mkdir -p objs | |
| gh release download release-objs \ | |
| --repo "${GITHUB_REPOSITORY}" \ | |
| --pattern "${ARCHIVE_NAME}" \ | |
| --dir "${RUNNER_TEMP}" | |
| tar -C objs -xzf "${RUNNER_TEMP}/${ARCHIVE_NAME}" | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| - name: Restore Bun cache | |
| id: bun-cache | |
| uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: &macos-build-ui-bun-cache-path | | |
| ~/.bun/install/cache | |
| key: ${{ runner.os }}-${{ runner.arch }}-build-ui-${{ hashFiles('bun.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-build-ui- | |
| - name: Build UI | |
| run: just build-ui | |
| - name: Build acton binary | |
| env: | |
| ACTON_RELEASE_CHANNEL: trunk | |
| run: cargo build --release --locked --target "${TARGET_NAME}" --bin acton | |
| - name: Add acton to PATH | |
| run: echo "${GITHUB_WORKSPACE}/target/${TARGET_NAME}/release" >> "$GITHUB_PATH" | |
| - name: Test acton binary | |
| run: | | |
| acton --help | |
| - name: Run tests | |
| if: steps.changes.outputs.packages_only != 'true' | |
| run: | | |
| just test | |
| - name: Save Bun cache | |
| if: github.ref == 'refs/heads/master' && steps.bun-cache.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: *macos-build-ui-bun-cache-path | |
| key: ${{ steps.bun-cache.outputs.cache-primary-key }} | |
| - name: Prepare trunk archive | |
| if: github.ref == 'refs/heads/master' && github.repository == 'ton-blockchain/acton' | |
| run: | | |
| cargo xtask dist archive --target "${TARGET_NAME}" --profile release | |
| - name: Upload trunk archive artifact | |
| if: github.ref == 'refs/heads/master' && github.repository == 'ton-blockchain/acton' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: artifacts-${{ env.TARGET_NAME }} | |
| path: | | |
| acton-${{ env.TARGET_NAME }}.tar.gz | |
| acton-${{ env.TARGET_NAME }}.tar.gz.sha256 | |
| retention-days: 1 | |
| if-no-files-found: error | |
| - name: Check Acton target binary | |
| shell: bash | |
| # language=Bash | |
| run: | | |
| python3 "${GITHUB_WORKSPACE}/.github/scripts/check-rust-target-binary.py" \ | |
| --binary "${GITHUB_WORKSPACE}/target/${TARGET_NAME}/release/acton" \ | |
| --target "${TARGET_NAME}" | |
| create-trunk-release: | |
| name: Create Trunk Release | |
| needs: [ build-linux, build-macos, lint ] | |
| runs-on: ubicloud-standard-2-ubuntu-2204 | |
| if: github.ref == 'refs/heads/master' && github.repository == 'ton-blockchain/acton' && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) | |
| permissions: | |
| actions: write | |
| contents: write | |
| steps: | |
| - name: Download trunk archives | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| pattern: artifacts-* | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Display structure of downloaded files | |
| run: ls -lhR artifacts | |
| - name: Delete previous trunk | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| # language=Bash | |
| run: | | |
| gh release delete trunk --repo "${GITHUB_REPOSITORY}" --cleanup-tag -y || true | |
| gh api repos/${GITHUB_REPOSITORY}/git/refs/tags/trunk -X DELETE || true | |
| - name: Create trunk release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| # language=Bash | |
| run: | | |
| release_notes=$(cat <<EOF | |
| Automated trunk build of Acton. | |
| Built from source commit: https://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA} | |
| EOF | |
| ) | |
| gh release create trunk \ | |
| --repo "${GITHUB_REPOSITORY}" \ | |
| artifacts/* \ | |
| --title "Trunk" \ | |
| --notes "${release_notes}" \ | |
| --target "${GITHUB_SHA}" \ | |
| --prerelease |