Skip to content

Commit

Permalink
[CI] - workflow maintenance (#2984)
Browse files Browse the repository at this point in the history
* refresh dockerfiles

* update prepare-binary to publish custom client versions

* fix upload/download for artifacts

* build all the versions (not only x86_64)

* fetch all the history to search for a specific commit

* build either a branch or a tag

* rename default binary (x86-64) to moonbeam

* use ubuntu+debian with same glibc version

* use job branch for loading resources

* use debian:stable as image for building

cfg moonbeam-networks

* use debian:stable as image

* creating the issue doesn't need bare-metal

* add permissions for build workflow

* use .nvmrc to set the node version

* add docker and scripts to codeowners

* update workflow permissions

* use ubuntu-latest for building binaries

* use ubuntu-latest to build release runtimes

* Testing faster machines

* using custom moonbeam GHA runner

* less expensive server for release

* Removes extra docker uid mapping from opslayer

* removes support for custom private repositories

* Try a better foreign initcode creation

* better check for initcode

* Remove cleanup used for permanent servers

* fixes permissions

* testing other instance

* fix typo

* Restore cheaper instances

* Updates node to v22

* fix yaml

* fixing permissions

* chore: 🔧 Update rustc 1.78 for check licenses

* Push client release on github hosted runners

* fixes permissions

---------

Co-authored-by: noandrea <[email protected]>
Co-authored-by: crystalin <[email protected]>
Co-authored-by: timbrinded <[email protected]>
Co-authored-by: Alan Sapede <[email protected]>
  • Loading branch information
5 people authored Nov 29, 2024
1 parent c8cc4ed commit 124d0a2
Show file tree
Hide file tree
Showing 27 changed files with 211 additions and 110 deletions.
5 changes: 2 additions & 3 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Changes to .github must be approved by the following groups

/.github/ @moonbeam-foundation/moonsong-perm @moonbeam-foundation/opslayer-devops
/tools/github/ @moonbeam-foundation/moonsong-perm @moonbeam-foundation/opslayer-devops

/docker/ @moonbeam-foundation/moonsong-perm @moonbeam-foundation/opslayer-devops
/scripts/ @moonbeam-foundation/moonsong-perm @moonbeam-foundation/opslayer-devops
2 changes: 1 addition & 1 deletion .github/workflow-templates/dev-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ runs:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 22
node-version-file: "test/.nvmrc"
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml

Expand Down
47 changes: 41 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
####### Check files and formatting #######
set-tags:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
git_branch: ${{ steps.check-git-ref.outputs.git_branch }}
git_ref: ${{ steps.check-git-ref.outputs.git_ref }}
Expand Down Expand Up @@ -116,6 +118,8 @@ jobs:
check-copyright:
runs-on: ubuntu-latest
permissions:
contents: read
needs: ["set-tags"]
steps:
- name: Checkout
Expand All @@ -134,6 +138,8 @@ jobs:
check-links:
runs-on: ubuntu-latest
permissions:
contents: read
needs: ["set-tags"]
steps:
- name: Checkout
Expand All @@ -148,6 +154,8 @@ jobs:
check-editorconfig:
name: "Check editorconfig"
runs-on: ubuntu-latest
permissions:
contents: read
needs: ["set-tags"]
steps:
- name: Checkout
Expand All @@ -168,6 +176,8 @@ jobs:
check-prettier:
name: "Check with Prettier"
runs-on: ubuntu-latest
permissions:
contents: read
needs: ["set-tags"]
steps:
- name: Checkout
Expand All @@ -191,6 +201,8 @@ jobs:
check-eslint:
name: "Check with EsLint"
runs-on: ubuntu-latest
permissions:
contents: read
needs: ["set-tags"]
steps:
- name: Checkout
Expand All @@ -204,7 +216,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22
node-version-file: "test/.nvmrc"
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
- name: Run Eslint check
Expand All @@ -216,7 +228,9 @@ jobs:
check-cargo-toml-format:
name: "Check Cargo.toml files format"
runs-on:
labels: bare-metal
labels: ubuntu-latest
permissions:
contents: read
needs: ["set-tags"]
steps:
- name: Checkout
Expand All @@ -235,6 +249,8 @@ jobs:
check-forbid-evm-reentrancy:
name: "Check 'forbid-evm-reentrancy'"
runs-on: ubuntu-latest
permissions:
contents: read
needs: ["set-tags"]
steps:
- name: Checkout
Expand All @@ -251,6 +267,8 @@ jobs:
check-rust-fmt:
name: "Check with rustfmt"
runs-on: ubuntu-latest
permissions:
contents: read
needs: ["set-tags"]
steps:
- name: Checkout
Expand All @@ -271,6 +289,8 @@ jobs:
cargo-clippy:
runs-on:
labels: bare-metal
permissions:
contents: read
needs: ["set-tags"]
steps:
- name: Checkout
Expand All @@ -296,6 +316,8 @@ jobs:
build:
runs-on:
labels: bare-metal
permissions:
contents: read
needs: ["set-tags"]
steps:
- name: Checkout
Expand Down Expand Up @@ -325,6 +347,9 @@ jobs:
check-wasm-size:
name: "Check WASM runtimes with Twiggy"
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
if: github.event_name == 'pull_request'
needs: ["set-tags", "build"]
env:
Expand Down Expand Up @@ -489,6 +514,8 @@ jobs:
rust-test:
runs-on:
labels: bare-metal
permissions:
contents: read
needs: ["set-tags"]
env:
RUSTC_WRAPPER: "sccache"
Expand Down Expand Up @@ -530,6 +557,8 @@ jobs:
dev-test:
runs-on:
labels: bare-metal
permissions:
contents: read
needs: ["set-tags", "build"]
timeout-minutes: 20
strategy:
Expand Down Expand Up @@ -594,6 +623,8 @@ jobs:
(github.event_name == 'push' && github.ref == 'refs/heads/master')
runs-on:
labels: bare-metal
permissions:
contents: read
needs: ["set-tags", "build", "dev-test"]
steps:
- name: Checkout
Expand All @@ -611,7 +642,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22
node-version-file: "test/.nvmrc"
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
- run: |
Expand Down Expand Up @@ -652,6 +683,8 @@ jobs:
docker-moonbeam:
runs-on: ubuntu-latest
permissions:
contents: read
needs: ["set-tags", "build"]
if: ${{ needs.set-tags.outputs.image_exists == 'false' && !github.event.pull_request.head.repo.fork }}
steps:
Expand Down Expand Up @@ -704,6 +737,8 @@ jobs:
lazy-loading-tests:
runs-on:
labels: bare-metal
permissions:
contents: read
needs: ["set-tags", "build", "typescript-tracing-tests"]
strategy:
fail-fast: false
Expand All @@ -724,7 +759,7 @@ jobs:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 22
node-version-file: "test/.nvmrc"
- name: Create local folders
run: |
mkdir -p target/release/wbuild/${{ matrix.chain }}-runtime/
Expand Down Expand Up @@ -795,7 +830,7 @@ jobs:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 22
node-version-file: "test/.nvmrc"
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
- name: Create local folders
Expand Down Expand Up @@ -860,7 +895,7 @@ jobs:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 22
node-version-file: "test/.nvmrc"
- name: Create local folders
run: |
mkdir -p target/release/wbuild/${{ matrix.chain }}-runtime/
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/cancel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ jobs:
name: "Cancel Previous Build"
if: github.ref != 'refs/heads/master'
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
timeout-minutes: 3
steps:
- uses: styfle/[email protected]
with:
workflow_id: ".github/workflows/build.yml,.github/workflows/coverage.yml"
all_but_latest: true
access_token: ${{ github.token }}
access_token: ${{ secrets.GITHUB_TOKEN }}
23 changes: 12 additions & 11 deletions .github/workflows/check-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,35 @@ name: Check benchmarks

on:
workflow_dispatch:
on:
schedule:
- cron: "0 5 * * 0" # Runs every Sunday at 5:00 AM UTC
- cron: "0 5 * * 3" # Runs every Wednesday at 5:00 AM UTC

jobs:
set-tags:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
git_ref: ${{ steps.check-git-ref.outputs.git_ref }}
steps:
- name: Check git ref
id: check-git-ref
# if PR
# else if manual PR
# else (push)
run: |
if [[ -n "${{ github.event.pull_request.head.sha }}" ]]; then
echo "git_ref=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT
echo "git_ref=${{ github.event.pull_request.head.sha }}" >> "$GITHUB_OUTPUT"
elif [[ -n "${{ github.event.inputs.pull_request }}" ]]; then
echo "git_ref=refs/pull/${{ github.event.inputs.pull_request }}/head" >> $GITHUB_OUTPUT
echo "git_ref=refs/pull/${{ github.event.inputs.pull_request }}/head" >> "$GITHUB_OUTPUT"
else
echo "git_ref=$GITHUB_REF" >> $GITHUB_OUTPUT
echo "git_ref=${GITHUB_REF}" >> "$GITHUB_OUTPUT"
fi
verify:
needs: ["set-tags"]
runs-on:
labels: bare-metal
permissions:
contents: read
strategy:
matrix:
runtime: [moonbeam, moonbase, moonriver]
Expand All @@ -38,12 +39,12 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ needs.set-tags.outputs.git_ref }}
persist-credentials: false
fetch-depth: 0
- name: Setup Variables
shell: bash
run: |
echo "RUSTFLAGS=-C opt-level=3 -D warnings -C linker=clang -C link-arg=-fuse-ld=$(pwd)/mold/bin/mold" >> $GITHUB_ENV
echo "RUSTFLAGS=-C opt-level=3 -D warnings -C linker=clang -C link-arg=-fuse-ld=$(pwd)/mold/bin/mold" >> "$GITHUB_ENV"
- name: Setup Mold Linker
shell: bash
run: |
mkdir -p mold
curl -L --retry 10 --silent --show-error https://github.com/rui314/mold/releases/download/v2.30.0/mold-2.30.0-$(uname -m)-linux.tar.gz | tar -C $(realpath mold) --strip-components=1 -xzf -
Expand All @@ -64,5 +65,5 @@ jobs:
./scripts/run-benches-for-runtime.sh ${{ matrix.runtime }} release
if test -f "benchmarking_errors.txt"; then
cat benchmarking_errors.txt
false
exit 1
fi
2 changes: 2 additions & 0 deletions .github/workflows/check-licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
jobs:
verify:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/client-release-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ on:

jobs:
setup-scripts:
runs-on: bare-metal
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Upload tools
Expand All @@ -23,13 +25,16 @@ jobs:
create_client_ticket:
needs: ["setup-scripts"]
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22
node-version-file: "test/.nvmrc"
- name: Download Original Tools
uses: actions/download-artifact@v4
with:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ jobs:
####### Check files and formatting #######

set-tags:
runs-on:
labels: bare-metal
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
git_branch: ${{ steps.check-git-ref.outputs.git_branch }}
git_target_branch: ${{ steps.check-git-ref.outputs.git_target_branch }}
Expand Down Expand Up @@ -89,6 +90,9 @@ jobs:
build-and-coverage:
runs-on:
labels: bare-metal
permissions:
contents: read
pull-requests: write
needs: ["set-tags"]
if: ${{ !github.event.pull_request.head.repo.fork }}
timeout-minutes: 90
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
deploy-docs:
name: Deploy docs
runs-on: bare-metal

permissions:
contents: read
steps:
# The protobuf compiler should be pre-installed on bare-metal
#- name: Install tooling
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/enforce-pr-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
jobs:
enforce-noteworthiness-label:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: yogevbd/[email protected]
with:
Expand All @@ -21,6 +23,8 @@ jobs:
BANNED_LABELS: ""
enforce-auditability-label:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: yogevbd/[email protected]
with:
Expand Down
Loading

0 comments on commit 124d0a2

Please sign in to comment.