diff --git a/.github/workflows/test.yml b/.github/workflows/build.yml similarity index 71% rename from .github/workflows/test.yml rename to .github/workflows/build.yml index d864b00..d296132 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ on: pull_request: jobs: - test-action: + test-build: runs-on: ubuntu-latest steps: @@ -17,7 +17,4 @@ jobs: - name: Test Setup Edgee Action uses: ./ with: - branch: "main" - - - name: Verify Edgee Installation - run: edgee --version + build: true diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml new file mode 100644 index 0000000..46beea8 --- /dev/null +++ b/.github/workflows/install.yml @@ -0,0 +1,18 @@ +name: "Test Setup Edgee Action" + +on: + push: + branches: + - main + pull_request: + +jobs: + test-install: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Test Setup Edgee Action + uses: ./ diff --git a/action.yml b/action.yml index 33f5ade..ae62cf6 100644 --- a/action.yml +++ b/action.yml @@ -2,14 +2,41 @@ name: "Install Edgee's CLI" description: "Install edgee from www.github.com/edgee-cloud/edgee" author: "edgee-cloud" +inputs: + build: + description: "Build Edgee from source instead of download" + required: false + default: "false" + runs: using: "composite" steps: + - name: Install dependencies + if: inputs.build == 'true' + run: | + sudo apt-get update + shell: bash + + - name: Install Rust toolchain + if: inputs.build == 'true' + uses: dtolnay/rust-toolchain@stable + + - name: Clone and Build Edgee + if: inputs.build == 'true' + run: | + git clone https://github.com/edgee-cloud/edgee.git + cd edgee + cargo build + mv ./target/debug/edgee /usr/local/bin/ + echo "Edgee built and added to path" + shell: bash + - name: Install Edgee + if: inputs.build == 'false' run: | curl https://install.edgee.cloud | sh mv edgee /usr/local/bin/ - echo "added edgee to path" + echo "Edgee downloaded and added to path" shell: bash - name: Verify Edgee installation