From 5b8f5d68ebb341a27e0229aa919c6562201cd7d9 Mon Sep 17 00:00:00 2001 From: Antoine THEBAUD Date: Tue, 19 Nov 2024 15:05:49 +0100 Subject: [PATCH] Add version parameter to Perses-CI + add test Signed-off-by: Antoine THEBAUD --- .github/workflows/ci.yaml | 46 ++++++++++++++++++++++ .github/workflows/test_install_percli.yaml | 23 ----------- action.yaml | 6 ++- 3 files changed, 51 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/ci.yaml delete mode 100644 .github/workflows/test_install_percli.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..75aba13 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,46 @@ +name: ci +on: + workflow_dispatch: # Allow manual triggering + push: + branches: + - main + - release/* + - snapshot/* + tags: + - v* + pull_request: + merge_group: +jobs: + test-perses-ci: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Call Perses-CI + uses: ./ + with: + version: "" + + - name: Validate code checkout + run: | + if [ ! -d ".github/perses-ci" ]; then + echo "Error: Source code was not checked out at the expected location." + exit 1 + fi + + if [ ! -f ".github/perses-ci/actions/setup_environment/action.yaml" ]; then + echo "Error: Expected file is missing." + exit 1 + fi + + test-install-percli: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install percli + uses: ./actions/install_percli + with: + cli_version: "latest" \ No newline at end of file diff --git a/.github/workflows/test_install_percli.yaml b/.github/workflows/test_install_percli.yaml deleted file mode 100644 index 742ab4d..0000000 --- a/.github/workflows/test_install_percli.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: Test Install percli -on: - workflow_dispatch: # Allow manual triggering - push: - branches: - - main - - release/* - - snapshot/* - tags: - - v* - pull_request: - merge_group: -jobs: - test-install-percli: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install percli - uses: ./actions/install_percli - with: - cli_version: "latest" \ No newline at end of file diff --git a/action.yaml b/action.yaml index 16701f8..3301f3b 100644 --- a/action.yaml +++ b/action.yaml @@ -1,5 +1,9 @@ name: Perses-CI description: An action used by the Perses project to share github actions. +inputs: + version: + description: "Version of perses/github-actions to use" + default: "" runs: using: composite steps: @@ -7,4 +11,4 @@ runs: with: repository: 'perses/github-actions' path: '.github/perses-ci' - ref: v0.5.2 + ref: ${{ inputs.version }}