Skip to content

Commit

Permalink
Merge branch 'main' into ISD-2620-allure
Browse files Browse the repository at this point in the history
  • Loading branch information
swetha1654 authored Dec 2, 2024
2 parents e6a8cea + e18e398 commit 849d974
Show file tree
Hide file tree
Showing 36 changed files with 19,842 additions and 15,369 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/comment_contributing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,14 @@ jobs:
const comments = "Thanks for opening a pull request! Please, check that you are following our \
[contributing guide](https://github.com/canonical/is-charms-contributing-guide/blob/main/CONTRIBUTING.md) \
and you are not introducing breaking changes in the target channel."
const owner = context.payload.workflow_run.repository.owner.login;
const repo = context.payload.workflow_run.repository.name;
const pull = (await github.rest.pulls.list({
owner: owner,
repo: repo,
})).data.filter(pr => pr.head.sha == context.payload.workflow_run.head_sha)[0];
const issue_number = pull.number;
const owner = context.payload.repository.owner.login;
const repo = context.payload.repository.name;
const issue_number = context.payload.number;
await github.rest.issues.createComment({
owner: owner,
repo: repo,
issue_number: issue_number,
body,
body: comments,
});
14 changes: 4 additions & 10 deletions .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ on:
Each mapping will be injected into the matrix section of the integration-test.
type: string
default: "{}"
image-build-args:
description: |
List of build args to pass to the build image job
type: string
default: ""
juju-channel:
description: Actions operator juju channel as per https://github.com/charmed-kubernetes/actions-operator#usage
type: string
Expand Down Expand Up @@ -183,7 +178,7 @@ on:
zap-target-port:
description: ZAP target port
type: string
default: 80
default: '80'
zap-target-protocol:
description: ZAP target protocol
type: string
Expand Down Expand Up @@ -219,7 +214,7 @@ jobs:
matrix:
build: ${{ fromJSON(needs.plan.outputs.plan).build }}
steps:
- uses: canonical/[email protected].1
- uses: canonical/[email protected].2
- name: Set LXC security nesting
if: ${{ inputs.rockcraft-enable-security-nesting }}
run: |
Expand Down Expand Up @@ -285,15 +280,14 @@ jobs:
docker image pull ${{ matrix.scan.image }}
docker image save -o ${{ matrix.scan.file }} ${{ matrix.scan.image }}
- name: Run Github Trivy Image Action
uses: aquasecurity/trivy-action@0.28.0
uses: aquasecurity/trivy-action@0.29.0
with:
input: ${{ matrix.scan.file }}
trivy-config: ${{ inputs.trivy-image-config }}
exit-code: '1'
severity: ${{ inputs.trivy-severity-config }}
env:
TRIVY_USERNAME: ${{ github.actor }}
TRIVY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
TRIVY_DISABLE_VEX_NOTICE: true
- name: Check trivyignore
run: |
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.46.0
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/integration_test_run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ on:
zap-target-port:
description: ZAP target port
type: string
default: 80
default: '80'
zap-target-protocol:
description: ZAP target protocol
type: string
Expand Down Expand Up @@ -330,11 +330,13 @@ jobs:
run: k6 run load_tests/load-test.js ${{ inputs.load-test-run-args }}
- name: Run Github Trivy FS Action
if: ${{ inputs.trivy-fs-enabled }}
uses: aquasecurity/trivy-action@0.28.0
uses: aquasecurity/trivy-action@0.29.0
with:
scan-type: "fs"
scan-ref: ${{ inputs.trivy-fs-ref }}
trivy-config: ${{ inputs.trivy-fs-config }}
env:
TRIVY_DISABLE_VEX_NOTICE: true
- name: Set Zap target env for Github Zap Action to Juju Unit IP Address
if: ${{ inputs.zap-enabled && inputs.zap-target == '' }}
run: echo "ZAP_TARGET=$(juju show-unit ${{ env.CHARM_NAME }}/0 --format=json | jq -r '.["${{ env.CHARM_NAME }}/0"]["address"]')" >> $GITHUB_ENV
Expand All @@ -348,7 +350,7 @@ jobs:
ZAP_TARGET: ${{ env.ZAP_TARGET }}
- name: Run Github Zap Action
if: ${{ inputs.zap-enabled }}
uses: zaproxy/action-baseline@v0.13.0
uses: zaproxy/action-baseline@v0.14.0
env:
ZAP_AUTH_HEADER: ${{ inputs.zap-auth-header }}
ZAP_AUTH_HEADER_VALUE: ${{ inputs.zap-auth-header-value }}
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/promote_charm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,11 @@ jobs:
id: docs-exist
run: echo "docs_exist=$([[ -d docs ]] && echo 'True' || echo 'False')" >> $GITHUB_OUTPUT
- name: Publish documentation
if: steps.docs-exist.outputs.docs_exist == 'True'
if: ${{ steps.docs-exist.outputs.docs_exist == 'True' && env.discourse_api_username != '' && env.discourse_api_key != '' }}
uses: canonical/discourse-gatekeeper@stable
env:
discourse_api_username: ${{ secrets.DISCOURSE_API_USERNAME }}
discourse_api_key: ${{ secrets.DISCOURSE_API_KEY }}
with:
discourse_host: discourse.charmhub.io
discourse_api_username: ${{ secrets.DISCOURSE_API_USERNAME }}
Expand All @@ -210,9 +213,12 @@ jobs:
id: docs-exist
run: echo "docs_exist=$([[ -d docs ]] && echo 'True' || echo 'False')" >> $GITHUB_OUTPUT
- name: Publish documentation
if: steps.docs-exist.outputs.docs_exist == 'True'
if: ${{ steps.docs-exist.outputs.docs_exist == 'True' && env.discourse_api_username != '' && env.discourse_api_key != '' }}
uses: canonical/discourse-gatekeeper@stable
id: publishDocumentation
env:
discourse_api_username: ${{ secrets.DISCOURSE_API_USERNAME }}
discourse_api_key: ${{ secrets.DISCOURSE_API_KEY }}
with:
discourse_host: discourse.charmhub.io
discourse_api_username: ${{ secrets.DISCOURSE_API_USERNAME }}
Expand All @@ -221,5 +227,8 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
charm_dir: ${{ inputs.working-directory }}/${{ inputs.charm-directory }}
- name: Show index page
if: steps.docs-exist.outputs.docs_exist == 'True'
if: ${{ steps.docs-exist.outputs.docs_exist == 'True' && env.discourse_api_username != '' && env.discourse_api_key != '' }}
run: echo '${{ steps.publishDocumentation.outputs.index_url }}'
env:
discourse_api_username: ${{ secrets.DISCOURSE_API_USERNAME }}
discourse_api_key: ${{ secrets.DISCOURSE_API_KEY }}
6 changes: 5 additions & 1 deletion .github/workflows/publish_charm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
- name: Select charmhub channel
uses: canonical/charming-actions/[email protected]
id: select-channel
continue-on-error: true
publish-charm:
name: Publish charm to ${{ inputs.channel || needs.select-channel.outputs.destination-channel }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -114,8 +115,11 @@ jobs:
id: docs-exist
run: echo "docs_exist=$([[ -d docs ]] && echo 'True' || echo 'False')" >> $GITHUB_OUTPUT
- name: Publish documentation
if: steps.docs-exist.outputs.docs_exist == 'True'
if: ${{ steps.docs-exist.outputs.docs_exist == 'True' && env.discourse_api_username != '' && env.discourse_api_key != '' }}
uses: canonical/discourse-gatekeeper@stable
env:
discourse_api_username: ${{ secrets.DISCOURSE_API_USERNAME }}
discourse_api_key: ${{ secrets.DISCOURSE_API_KEY }}
with:
discourse_host: discourse.charmhub.io
discourse_api_username: ${{ secrets.DISCOURSE_API_USERNAME }}
Expand Down
32 changes: 30 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,31 @@ jobs:
filter-mode: nofilter
workdir: ${{ inputs.working-directory }}
woke-version: latest
vale:
name: Style checker
runs-on: >-
${{
inputs.self-hosted-runner &&
fromJson(format('[''self-hosted'', ''{0}'', ''{1}'', ''{2}'']',
inputs.self-hosted-runner-arch, inputs.self-hosted-runner-label, inputs.self-hosted-runner-image
)) || 'ubuntu-22.04'
}}
defaults:
run:
shell: bash
working-directory: ${{ inputs.working-directory }}
steps:
- name: Checkout repo to runner
uses: actions/[email protected]
- run: |
sudo apt-get update -y && sudo apt-get install -y tree ruby-rubygems
- name: Install styles
uses: canonical/praecepta@main
- name: Run Vale tests
uses: errata-ai/vale-action@reviewdog
with:
files: ${{ inputs.charm-directory }}/docs
fail_on_error: false
shellcheck-lint:
name: Shell scripts lint
runs-on: >-
Expand Down Expand Up @@ -301,7 +326,7 @@ jobs:
const sha = '${{ github.event.pull_request.head.sha }}';
const fs = require('fs');
const result = JSON.parse(fs.readFileSync('${{ inputs.working-directory }}test-result.json')).testenvs;
const result = JSON.parse(fs.readFileSync('${{ inputs.working-directory }}/test-result.json')).testenvs;
let lint_result = result.lint.test;
let lint_success = true;
Expand Down Expand Up @@ -368,8 +393,11 @@ jobs:
id: docs-exist
run: echo "docs_exist=$([[ -d docs ]] && echo 'True' || echo 'False')" >> $GITHUB_OUTPUT
- name: Publish documentation
if: ${{ steps.docs-exist.outputs.docs_exist == 'True' && !github.event.pull_request.head.repo.fork }}
if: ${{ steps.docs-exist.outputs.docs_exist == 'True' && !github.event.pull_request.head.repo.fork && env.discourse_api_username != '' && env.discourse_api_key != '' }}
uses: canonical/discourse-gatekeeper@stable
env:
discourse_api_username: ${{ secrets.DISCOURSE_API_USERNAME }}
discourse_api_key: ${{ secrets.DISCOURSE_API_KEY }}
with:
discourse_host: discourse.charmhub.io
discourse_api_username: ${{ secrets.DISCOURSE_API_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.18.0
22.11.0
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ The following secrets are available for this workflow:
When running the integration tests, the following posargs will be automatically passed to the `integration` target:

* --charm-file [charm_file_name]: The name of the charm artifact generated prior to the integration tests run, this argument can be supplied multiple times for charm with multiple bases.
* --{image-name}-image: The name of the image artifact built prior to the integration tests run, this argument may be supplied multiple times or not at all depending on the plan
* --{resource-name}-resource: The name of the charm file resources built prior to the integration tests run, this argument may be supplied multiple times or not at all depending on the plan
* --series [series]: As defined in the `series` configuration described option above
* -k [module]: As defined in the `modules` configuration option described above
* --keep-models
Expand Down
Loading

0 comments on commit 849d974

Please sign in to comment.