From 2cd9109ef4821f2bd070ecec5295d2b6d34c788c Mon Sep 17 00:00:00 2001 From: Florian Rey Date: Fri, 13 Sep 2024 16:28:51 +0200 Subject: [PATCH] Fix release --- .github/workflows/lint.yaml | 21 --------- .github/workflows/prout.yaml | 29 ++++++++++++ .github/workflows/release.yaml | 84 ---------------------------------- .github/workflows/test.yaml | 29 ------------ Makefile | 15 +++++- plugins/filter/join.py | 2 +- plugins/filter/join.yml | 19 ++++++++ 7 files changed, 63 insertions(+), 136 deletions(-) delete mode 100644 .github/workflows/lint.yaml create mode 100644 .github/workflows/prout.yaml delete mode 100644 .github/workflows/release.yaml delete mode 100644 .github/workflows/test.yaml create mode 100644 plugins/filter/join.yml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml deleted file mode 100644 index 8380664..0000000 --- a/.github/workflows/lint.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: Lint - -on: - pull_request: - workflow_dispatch: - -jobs: - lint: - name: Lint - runs-on: ubuntu-24.04 - steps: - - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up system - uses: ./.manala/github/system/setup - - - name: Lint - run: | - make lint VERBOSE=1 diff --git a/.github/workflows/prout.yaml b/.github/workflows/prout.yaml new file mode 100644 index 0000000..11d868f --- /dev/null +++ b/.github/workflows/prout.yaml @@ -0,0 +1,29 @@ +name: Release + +on: + pull_request: + workflow_dispatch: + +env: + ACTIONS_STEP_DEBUG: true + +jobs: + release: + name: Release + runs-on: ubuntu-24.04 + steps: + + - name: Checkout + uses: actions/checkout@v4 + + - name: Get metadata from galaxy.yml + id: metadata + uses: CumulusDS/get-yaml-paths-action@v1.0.2 + with: + file: galaxy.yml + + - run: | + echo prout start + echo zzz${{ steps.metadata.outputs }}zzz + echo zzz${{ steps.metadata.outputs.version }}zzz + echo prout stop diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index 7cb88e4..0000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,84 +0,0 @@ -name: Release - -on: - push: - branches: - - main - -jobs: - release: - name: Release - runs-on: ubuntu-24.04 - if: github.event.head_commit.message == 'Release' - steps: - - - name: Notify Slack - Starting - uses: act10ns/slack@v2 - with: - status: starting - channel: '#collection_release' - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - - name: Checkout - uses: actions/checkout@v4 - - - name: Set ansible galaxy token - run: | - cat << EOF > ./galaxy_token - token: ${{ secrets.ANSIBLE_GALAXY_TOKEN }} - EOF - - - name: Set up system - uses: ./.manala/github/system/setup - - - name: Get metadata from galaxy.yml - id: metadata - uses: CumulusDS/get-yaml-paths-action@v1.0.2 - with: - file: ./galaxy.yml - - - name: Build - id: build - run: | - make build VERBOSE=1 - - - name: Upload build artifact - uses: actions/upload-artifact@v4 - with: - path: ./manala-path-${{ steps.metadata.outputs.version }}.tar.gz - name: manala-path-${{ steps.metadata.outputs.version }} - retention-days: 1 - - - name: Publish - id: publish - run: | - make publish VERBOSE=1 - - - name: Get Changelog entry - id: changelog - uses: mindsers/changelog-reader-action@v2 - with: - path: ./CHANGELOG.md - version: ${{ steps.metadata.outputs.version }} - - - name: Create GitHub Release - id: release - uses: ncipollo/release-action@v1 - with: - name: manala-path ${{ steps.metadata.outputs.version }} - tag: ${{ steps.metadata.outputs.version }} - body: ${{ steps.changelog.outputs.changes }} - artifacts: ./manala-path-${{ steps.metadata.outputs.version }}.tar.gz - token: ${{ secrets.GITHUB_TOKEN }} - skipIfReleaseExists: true - - - name: Notify Slack - Status - uses: act10ns/slack@v2 - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: '#collection_release' - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - if: always() diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index 902d2b8..0000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: Test - -on: - pull_request: - workflow_dispatch: - -jobs: - test: - name: Test - runs-on: ubuntu-24.04 - steps: - - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up system - uses: ./.manala/github/system/setup - - - name: Sanity - run: | - make test.sanity VERBOSE=1 - - - name: Units - run: | - make test.units VERBOSE=1 - - - name: Integration - run: | - make test.integration VERBOSE=1 diff --git a/Makefile b/Makefile index 4e22c55..cf86094 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ lint: # Test # ######## -## Test - Run all tests (but coverage) +## Test - Run all tests (but doc and coverage) test: test.sanity test.units test.integration .PHONY: test @@ -59,6 +59,19 @@ test.integration: --color yes .PHONY: test.integration +## Test - Run documentation tests [VERBOSE] +test.doc: SHELL := $(MANALA_DOCKER_SHELL) +test.doc: + $(foreach type,module filter, \ + $(foreach plugin,$(shell ansible-doc --list manala.path --type $(type) | cut -d " " -f 1), \ + ansible-doc \ + $(if $(VERBOSE), --verbose) \ + --type $(type) \ + $(plugin) && \ + ) \ + ) true +.PHONY: test.doc + ## Test - Run coverage [VERBOSE] test.coverage: SHELL := $(MANALA_DOCKER_SHELL) test.coverage: diff --git a/plugins/filter/join.py b/plugins/filter/join.py index 570e002..f55cafe 100644 --- a/plugins/filter/join.py +++ b/plugins/filter/join.py @@ -17,7 +17,7 @@ def join(elements, *paths): class FilterModule(object): - ''' Manala join jinja2 filters ''' + ''' Manala path join jinja2 filters ''' def filters(self): filters = { diff --git a/plugins/filter/join.yml b/plugins/filter/join.yml new file mode 100644 index 0000000..3d79384 --- /dev/null +++ b/plugins/filter/join.yml @@ -0,0 +1,19 @@ +DOCUMENTATION: + name: join + author: + - Manala (@manala) + short_description: Join path elements list to one or more path components + description: + - Returns a path elements list obtained by joining each element's path to one or more path components. + positional: _input,_paths + options: + _input: + description: A list of elements. + type: list + elements: object + required: true + _paths: + description: A path, or a list of paths. + type: list + elements: str + required: true