Skip to content

Commit

Permalink
chore(CI): Remove useless expression evaluations in actions (#2058)
Browse files Browse the repository at this point in the history
* Remove useless expression evaluations in actions

* Some more
  • Loading branch information
Dr-Electron authored Aug 26, 2024
1 parent f7d2afb commit b85cc4f
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ jobs:
run: pnpm dlx concurrently --kill-others --success command-1 "$E2E_RUN_LOCAL_NET_CMD" 'pnpm --filter @iota/graphql-transport test:e2e'

- name: Build explorer
if: ${{ inputs.isTypescriptSDK || inputs.isExplorer || inputs.isRust}}
if: inputs.isTypescriptSDK || inputs.isExplorer || inputs.isRust
run: pnpm turbo --filter=iota-explorer build

- name: Run Explorer e2e tests
# need to run Explorer e2e when its upstream(TS SDK and Rust) or itself is changed
if: ${{ inputs.isTypescriptSDK || inputs.isExplorer || inputs.isRust}}
if: inputs.isTypescriptSDK || inputs.isExplorer || inputs.isRust
run: pnpm --filter iota-explorer playwright test
- uses: actions/upload-artifact@v3
if: always()
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/_turborepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ jobs:
continue-on-error: true
run: pnpm dlx turbo-ignore iota-wallet
- name: Wallet Extension Preview Package
if: ${{ steps.wallet-diff.outcome == 'failure' }}
if: steps.wallet-diff.outcome == 'failure'
run: pnpm --filter iota-wallet pack:zip
- uses: actions/upload-artifact@v3
if: ${{ steps.wallet-diff.outcome == 'failure' }}
if: steps.wallet-diff.outcome == 'failure'
with:
name: wallet-extension
path: apps/wallet/web-ext-artifacts/*
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
run: sudo apt-get install -y libpq-dev

- name: Set os/arch variables
if: ${{ matrix.os != 'windows-ghcloud' }}
if: matrix.os != 'windows-ghcloud'
shell: bash
run: |
export arch=$(uname -m)
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/hierarchy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
license-check:
name: license-check
needs: diff
if: always() && ${{ needs.diff.outputs.isRust == 'true' }}
if: always() && needs.diff.outputs.isRust == 'true'
runs-on: [self-hosted]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
Expand All @@ -58,18 +58,18 @@ jobs:

docusaurus:
needs: diff
if: always() && ${{ needs.diff.outputs.isDoc == 'true' }}
if: always() && needs.diff.outputs.isDoc == 'true'
uses: ./.github/workflows/_docusaurus.yml

docs-lint:
needs: diff
if: always() && ${{ needs.diff.outputs.isDoc == 'true' }}
if: always() && needs.diff.outputs.isDoc == 'true'
uses: ./.github/workflows/_docs_lint.yml

release-notes-description-check:
name: release-notes-check
needs: diff
if: always() && ${{ needs.diff.outputs.isReleaseNotesEligible == 'true' }}
if: always() && needs.diff.outputs.isReleaseNotesEligible == 'true'
runs-on: [self-hosted]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
- dprint-format
- license-check
- typos
if: always() && ${{ needs.diff.outputs.isRust == 'false' && needs.diff.outputs.isMove == 'true' }} && github.event.pull_request.draft == false
if: always() && needs.diff.outputs.isRust == 'false' && needs.diff.outputs.isMove == 'true' && github.event.pull_request.draft == false
uses: ./.github/workflows/_move_tests.yml

rust:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/links_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create issue from report file
if: ${{ steps.last_issue.outputs.has_found == 'false' }}
if: steps.last_issue.outputs.has_found == 'false'
uses: peter-evans/create-issue-from-file@v4
with:
title: Link checker report
Expand All @@ -62,7 +62,7 @@ jobs:
automated issue
- name: Update last report open issue created
if: ${{ steps.last_issue.outputs.has_found == 'true' }}
if: steps.last_issue.outputs.has_found == 'true'
uses: peter-evans/create-issue-from-file@v4
with:
title: Link checker report
Expand All @@ -73,7 +73,7 @@ jobs:
automated issue
- name: Close last report open issue
if: ${{ steps.lychee.outputs.exit_code == 0 }}
if: steps.lychee.outputs.exit_code == 0
uses: peter-evans/close-issue@v3
with:
issue-number: ${{ steps.last_issue.outputs.issue_number }}
8 changes: 4 additions & 4 deletions .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ on:

jobs:
build-iota-node:
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.iota_node == 'true' || github.event_name == 'release' }}
if: github.event_name == 'workflow_dispatch' && github.event.inputs.iota_node == 'true' || github.event_name == 'release'
runs-on: self-hosted
environment: release
steps:
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
pull: true

build-iota-indexer:
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.iota_indexer == 'true' || github.event_name == 'release' }}
if: github.event_name == 'workflow_dispatch' && github.event.inputs.iota_indexer == 'true' || github.event_name == 'release'
runs-on: self-hosted
environment: release
steps:
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
pull: true

build-iota-tools:
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.iota_tools == 'true' || github.event_name == 'release' }}
if: github.event_name == 'workflow_dispatch' && github.event.inputs.iota_tools == 'true' || github.event_name == 'release'
runs-on: self-hosted
environment: release
steps:
Expand Down Expand Up @@ -163,7 +163,7 @@ jobs:
pull: true

build-iota-graphql-rpc:
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.iota_graphql_rpc == 'true' || github.event_name == 'release' }}
if: github.event_name == 'workflow_dispatch' && github.event.inputs.iota_graphql_rpc == 'true' || github.event_name == 'release'
runs-on: self-hosted
environment: release
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-notes-monitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
process-prs:
name: Processing PR
needs: [get-list-of-prs]
if: ${{ needs.get-list-of-prs.outputs.matrix != '[]' && needs.get-list-of-prs.outputs.matrix != '' }}
if: needs.get-list-of-prs.outputs.matrix != '[]' && needs.get-list-of-prs.outputs.matrix != ''
runs-on: self-hosted
strategy:
matrix:
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
name: Adding git tag to processed commit
runs-on: self-hosted
needs: [get-list-of-prs]
if: ${{ success() && needs.get-list-of-prs.outputs.existing_commit_tag == '' }}
if: success() && needs.get-list-of-prs.outputs.existing_commit_tag == ''
uses: iotaledger/iota/.github/workflows/tag.yml@main
with:
iota_commit: ${{ needs.get-list-of-prs.outputs.new_commit_hash }}
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,23 @@ jobs:
echo "iota_version=${iota_version}" >> $GITHUB_ENV
- name: Configure AWS credentials
if: ${{ env.TAG_NAME != 'main' }}
if: env.TAG_NAME != 'main'
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # pin v4.0.2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2

- name: Set os/arch variables (Windows)
if: ${{ matrix.os == 'windows-ghcloud' }}
if: matrix.os == 'windows-ghcloud'
shell: bash
run: |
export arch=$(uname -m)
export os_type="windows-${arch}"
echo "os_type=${os_type}" >> $GITHUB_ENV
- name: Set os/arch variables
if: ${{ matrix.os != 'windows-ghcloud' }}
if: matrix.os != 'windows-ghcloud'
shell: bash
run: |
export arch=$(uname -m)
Expand All @@ -89,29 +89,29 @@ jobs:
echo "s3_archive_exist=$(curl -Is https://iota-releases.s3.us-east-1.amazonaws.com/releases/iota-${{ env.iota_tag }}-${{ env.os_type }}.tgz | head -n 1 | grep '200 OK')" >> $GITHUB_ENV
- name: Download archive, if it exists
if: ${{ env.s3_archive_exist != '' }}
if: env.s3_archive_exist != ''
shell: bash
run: |
mkdir -p ./target/release
aws s3 cp s3://iota-releases/releases/iota-${{ env.iota_tag }}-${os_type}.tgz ./target/release/iota-${{ env.iota_tag }}-${os_type}.tgz
- name: Setup caching
if: ${{ env.s3_archive_exist == '' }}
if: env.s3_archive_exist == ''
uses: bmwill/rust-cache@v1 # Fork of 'Swatinem/rust-cache' which allows caching additional paths

- name: Install nexttest (Windows)
if: ${{ matrix.os == 'windows-ghcloud' && env.s3_archive_exist == '' }}
if: matrix.os == 'windows-ghcloud' && env.s3_archive_exist == ''
uses: taiki-e/install-action@33022ba120c3f523d134bbbee12278fc11a3df1a # pin@nextest

- name: Setup protoc (Windows)
if: ${{ matrix.os == 'windows-ghcloud' && env.s3_archive_exist == '' }}
if: matrix.os == 'windows-ghcloud' && env.s3_archive_exist == ''
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # [email protected]
# this avoids rate-limiting
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install postgres (Windows)
if: ${{ matrix.os == 'windows-ghcloud' && env.s3_archive_exist == '' }}
if: matrix.os == 'windows-ghcloud' && env.s3_archive_exist == ''
shell: bash
run: |
choco install postgresql12 --force --params '/Password:root'
Expand All @@ -122,20 +122,20 @@ jobs:
echo "PG_EXAMPLE_DATABASE_URL=postgres://postgres:root@localhost/diesel_example" >> $GITHUB_ENV
- name: Checking out ${{ env.iota_tag }}
if: ${{ env.s3_archive_exist == '' }}
if: env.s3_archive_exist == ''
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3
with:
ref: ${{ env.iota_tag }}

- name: cargo build (release) for ${{ matrix.os }} platform
if: ${{ env.s3_archive_exist == '' }}
if: env.s3_archive_exist == ''
shell: bash
run: |
[ -f ~/.cargo/env ] && source ~/.cargo/env ; cargo build --release
cd external-crates/move && cargo build -p move-analyzer --release
- name: Rename binaries for ${{ matrix.os }}
if: ${{ matrix.os != 'windows-ghcloud' && env.s3_archive_exist == '' }}
if: matrix.os != 'windows-ghcloud' && env.s3_archive_exist == ''
shell: bash
run: |
[ -f ./target/release/iota ] && mv ./target/release/iota ./target/release/iota-${os_type}
Expand All @@ -149,7 +149,7 @@ jobs:
[[ ${{ env.iota_tag }} == *"testnet"* ]] && aws s3 cp ./target/release/iota-${{ env.iota_tag }}-${os_type}.tgz s3://iota-releases/releases/iota-${{ env.iota_tag }}-${os_type}.tgz || true
- name: Rename binaries for Windows
if: ${{ matrix.os == 'windows-ghcloud' && env.s3_archive_exist == '' }}
if: matrix.os == 'windows-ghcloud' && env.s3_archive_exist == ''
shell: bash
run: |
[ -f ./target/release/iota.exe ] && cp ./target/release/iota.exe ./target/release/iota-${os_type}.exe
Expand All @@ -164,7 +164,7 @@ jobs:
[[ ${{ env.iota_tag }} == *"testnet"* ]] && aws s3 cp ./target/release/iota-${{ env.iota_tag }}-${os_type}.tgz s3://iota-releases/releases/iota-${{ env.iota_tag }}-${os_type}.tgz || true
- name: "Publish Windows iota binary to Chocolately"
if: ${{ matrix.os == 'windows-ghcloud' && env.s3_archive_exist == '' && contains( env.iota_tag, 'testnet') }}
if: matrix.os == 'windows-ghcloud' && env.s3_archive_exist == '' && contains( env.iota_tag, 'testnet')
working-directory: chocolatey
continue-on-error: true
shell: bash
Expand Down Expand Up @@ -205,7 +205,7 @@ jobs:
needs: release-build
runs-on: self-hosted
# releasing iota cli on testnet releases because it lags `main` less than mainnet, but is more likely to be stable than devnet
if: ${{ contains( inputs.iota_tag, 'testnet') || contains( github.ref, 'testnet') }}
if: contains( inputs.iota_tag, 'testnet') || contains( github.ref, 'testnet')
steps:
- name: Clean up tag name ${{ env.TAG_NAME }}
shell: bash
Expand All @@ -231,7 +231,7 @@ jobs:
name: Update homebrew-tap iota.rb file
needs: release-build
runs-on: self-hosted
if: ${{ contains( inputs.iota_tag, 'testnet') || contains( github.ref, 'testnet') }}
if: contains( inputs.iota_tag, 'testnet') || contains( github.ref, 'testnet')
steps:
- name: Clean up tag name ${{ env.TAG_NAME }}
shell: bash
Expand Down

0 comments on commit b85cc4f

Please sign in to comment.