Skip to content

Commit

Permalink
Add actions to install CLI and run move tests
Browse files Browse the repository at this point in the history
  • Loading branch information
banool committed Jan 15, 2025
1 parent fee78f6 commit 2355cc5
Show file tree
Hide file tree
Showing 9 changed files with 768 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/move/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.aptos/
build/
15 changes: 15 additions & 0 deletions .github/workflows/move/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "testing"
version = "1.0.0"
authors = []

[addresses]

[dev-addresses]

[dependencies.AptosFramework]
git = "https://github.com/aptos-labs/aptos-framework.git"
rev = "mainnet"
subdir = "aptos-framework"

[dev-dependencies]
5 changes: 5 additions & 0 deletions .github/workflows/move/sources/code.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module 0x5::mymodule {
struct Test {
x: u64
}
}
8 changes: 8 additions & 0 deletions .github/workflows/test-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,11 @@ jobs:
- run: curl --fail http://127.0.0.1:8081
- run: |
curl --fail http://127.0.0.1:8090/v1/graphql --data-raw '{"query":"{processor_status {last_success_version processor}}"}' || if [ $? -eq 7 ]; then exit 0; else exit 1; fi
run-test-move:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./test-move
with:
WORKING_DIRECTORY: .github/workflows/move
18 changes: 18 additions & 0 deletions install-aptos-cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Description

Install the Aptos CLI. By default we use the latest released version of the Aptos CLI but you can specify the version. For now this only works on Linux runners.

## Inputs

| parameter | description | required | default |
| --- | --- | --- | --- |
| INSTALL_DIRECTORY | The directory to install the Aptos CLI. If not specified, it will be installed in /usr/local/bin | `false` | /usr/local/bin |
| CLI_VERSION | The version of the Aptos CLI to install. If not specified, the latest version will be installed. | `false` | |
| SHELL | The shell to use for the steps. | `false` | bash |


## Runs

This action is a `composite` action.


27 changes: 27 additions & 0 deletions install-aptos-cli/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Install Aptos CLI
description: Install the Aptos CLI. By default we use the latest released version of the Aptos CLI but you can specify the version. For now this only works on Linux runners.

inputs:
INSTALL_DIRECTORY:
description: "The directory to install the Aptos CLI. If not specified, it will be installed in /usr/local/bin"
required: false
default: "/usr/local/bin"
CLI_VERSION:
description: "The version of the Aptos CLI to install. If not specified, the latest version will be installed."
required: false
default: ""
SHELL:
description: "The shell to use for the steps."
required: false
default: "bash"

runs:
using: composite
steps:
- name: Fetch installation script
shell: ${{ inputs.SHELL }}
run: curl -fSL "https://aptos.dev/scripts/install_cli.py" -o ${{ runner.temp }}/install_cli.py

- name: Install Aptos CLI
shell: ${{ inputs.SHELL }}
run: python3 ${{ runner.temp }}/install_cli.py -f -y --bin-dir ${{ inputs.INSTALL_DIRECTORY }} ${{ inputs.CLI_VERSION != '' && format('--cli-version {0}', inputs.CLI_VERSION) }}
Loading

0 comments on commit 2355cc5

Please sign in to comment.