Skip to content

Commit

Permalink
[ci] fix artifact dl/ul (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
kalvkusk authored and 0o-de-lally committed Aug 8, 2024
1 parent 4f85cf6 commit 46484e9
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 44 deletions.
77 changes: 69 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,24 @@ jobs:
runs-on: debian-latest
steps:
- uses: actions/checkout@v3

- name: setup env
uses: ./.github/actions/build_env

- uses: Swatinem/rust-cache@v2.7.3
with:
shared-key: "libra-framework"
cache-all-crates: true

- name: build framework
working-directory: ./framework
run: cargo r release

- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4.3.1
with:
name: framework-build
path: framework/*

types:
timeout-minutes: 60
needs: [build-framework]
Expand All @@ -43,38 +51,58 @@ jobs:
- name: setup env
uses: ./.github/actions/build_env

- uses: Swatinem/rust-cache@v2.7.3
with:
shared-key: "libra-framework"
cache-all-crates: true

# fail fast if types doesnt compile, everything else will fail.
- name: types
working-directory: ./types
run: cargo test --no-fail-fast

wallet:
timeout-minutes: 60
needs: [build-framework]
runs-on: debian-latest
steps:
- uses: actions/checkout@v3

- name: setup env
uses: ./.github/actions/build_env

- uses: Swatinem/rust-cache@v2.7.3
with:
shared-key: "libra-framework"
cache-all-crates: true

- name: wallet
if: always()
working-directory: ./tools/wallet
run: cargo test --no-fail-fast

# NOTE: all jobs below need the fresh framework build
# NOTE: all jobs below need the fresh framework build
smoke:
timeout-minutes: 60
needs: [build-framework]
runs-on: debian-latest
steps:
- uses: actions/checkout@v3

- name: setup env
uses: ./.github/actions/build_env

# make sure we have a fresh framework build
- uses: actions/download-artifact@master
- uses: actions/download-artifact@v4.1.2
with:
name: framework-build
path: framework/

- uses: Swatinem/rust-cache@v2.7.3
with:
shared-key: "libra-framework"
cache-all-crates: true

# Check test suite meta tests
- name: smoke-tests # NOTE: needs working DIEM_FORGE_NODE_BIN_PATH
if: always()
Expand All @@ -90,10 +118,16 @@ jobs:
- name: setup env
uses: ./.github/actions/build_env

- uses: actions/download-artifact@master
- uses: Swatinem/rust-cache@v2.7.3
with:
shared-key: "libra-framework"
cache-all-crates: true

- uses: actions/download-artifact@v4.1.2
with:
name: framework-build
path: framework/

# Tools tests (some use smoke-tests)
- name: query
if: always()
Expand All @@ -106,28 +140,45 @@ jobs:
runs-on: debian-latest
steps:
- uses: actions/checkout@v3

- name: setup env
uses: ./.github/actions/build_env
- uses: actions/download-artifact@master

- uses: Swatinem/rust-cache@v2.7.3
with:
shared-key: "libra-framework"
cache-all-crates: true

- uses: actions/download-artifact@v4.1.2
with:
name: framework-build
path: framework/

- name: genesis
if: always()
working-directory: ./tools/genesis
run: cargo test --no-fail-fast

tower:
timeout-minutes: 60
needs: [build-framework]
runs-on: debian-latest
steps:
- uses: actions/checkout@v3

- name: setup env
uses: ./.github/actions/build_env
- uses: actions/download-artifact@master

- uses: Swatinem/rust-cache@v2.7.3
with:
shared-key: "libra-framework"
cache-all-crates: true

- uses: actions/download-artifact@v4.1.2
with:
name: framework-build
path: framework/

- name: tower
if: always()
working-directory: ./tools/tower
Expand All @@ -139,12 +190,20 @@ jobs:
runs-on: debian-latest
steps:
- uses: actions/checkout@v3

- name: setup env
uses: ./.github/actions/build_env
- uses: actions/download-artifact@master

- uses: Swatinem/rust-cache@v2.7.3
with:
shared-key: "libra-framework"
cache-all-crates: true

- uses: actions/download-artifact@v4.1.2
with:
name: framework-build
path: framework/

- name: txs
if: always()
working-directory: ./tools/txs
Expand All @@ -157,9 +216,11 @@ jobs:
runs-on: debian-latest
steps:
- uses: actions/checkout@v3

- name: setup env
uses: ./.github/actions/build_env
- uses: actions/download-artifact@master

- uses: actions/download-artifact@v4.1.2
with:
name: framework-build
path: framework/
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/cleanliness.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ name: cleanliness
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+'
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
branches: ["*"]
pull_request:
types:
- opened
- synchronize
branches:
- 'release**'
- 'main**'
- "release**"
- "main**"
env:
DIEM_FORGE_NODE_BIN_PATH: ${{github.workspace}}/diem-node
LIBRA_CI: 1
Expand All @@ -26,6 +26,11 @@ jobs:
- name: setup env
uses: ./.github/actions/build_env

- uses: Swatinem/rust-cache@v2.7.3
with:
shared-key: "libra-framework"
cache-all-crates: true

- name: format
uses: actions-rs/cargo@v1
with:
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/formal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ name: formal verification
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+'
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
branches: ["*"]
pull_request:
types:
- opened
- synchronize
branches:
- 'release**'
- 'main**'
- "release**"
- "main**"
env:
DOTNET_ROOT: "/home/github-runner/.dotnet"
Z3_EXE: "/home/github-runner/bin/z3"
Expand All @@ -31,14 +31,18 @@ jobs:
# timeout-minutes: 15

- uses: actions/checkout@v3

- name: setup env
uses: ./.github/actions/build_env

- uses: Swatinem/rust-cache@v2.7.3
with:
shared-key: "libra-framework"
cache-all-crates: true

- name: install prover dependencies
run: |
bash util/dev_setup.sh -byp
bash util/dev_setup.sh -byp
- name: install diem (for move tests)
run: |
Expand Down
45 changes: 25 additions & 20 deletions .github/workflows/move.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,41 @@ name: move framework tests
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+'
branches: ['*']
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
branches: ["*"]
pull_request:
types:
- opened
- synchronize
branches:
- 'release**'
- 'main**'
- "release**"
- "main**"

jobs:
functional-tests:
runs-on: debian-latest
steps:
# NOTE: for debugging CI this allow shell access to github runner. Will print out tmate.io terminal url
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# with:
# detached: true
# timeout-minutes: 15
# NOTE: for debugging CI this allow shell access to github runner. Will print out tmate.io terminal url
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# with:
# detached: true
# timeout-minutes: 15

- uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: install diem (for move tests)
run: >
wget -O ${{github.workspace}}/diem https://github.com/0LNetworkCommunity/diem/releases/latest/download/diem &&
chmod +x ${{github.workspace}}/diem
- name: install diem (for move tests)
run: >
wget -O ${{github.workspace}}/diem https://github.com/0LNetworkCommunity/diem/releases/latest/download/diem &&
chmod +x ${{github.workspace}}/diem
- uses: Swatinem/rust-cache@v2.7.3
with:
shared-key: "libra-framework"
cache-all-crates: true

# Move framework tests
- name: move framework
working-directory: ./framework/libra-framework
run: ${{github.workspace}}/diem move test
# Move framework tests
- name: move framework
working-directory: ./framework/libra-framework
run: ${{github.workspace}}/diem move test
13 changes: 7 additions & 6 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ name: publish bin
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+'
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
branches:
- 'ci'
- "ci"
jobs:
publish:
permissions: write-all
permissions:
write-all
# contents: write
name: publish
runs-on: debian-latest
Expand Down Expand Up @@ -39,7 +40,7 @@ jobs:
with:
components: rustfmt

######## CACHE ########
######## CACHE ########
- name: system packages
uses: awalsh128/cache-apt-pkgs-action@latest
with:
Expand All @@ -54,7 +55,7 @@ jobs:

# note: building in the same cargo command will lead to "feature unification", which leads to a `diem-node` binary which fails.
- name: libra release build
# size and performance optimized binary with profile.cli
# size and performance optimized binary with profile.cli
run: cargo b --release -p libra

- name: libra publish
Expand Down

0 comments on commit 46484e9

Please sign in to comment.