Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: switch back to pull_request event trigger for gh actions #591

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions .github/workflows/cla_check.yml

This file was deleted.

52 changes: 0 additions & 52 deletions .github/workflows/delete_test_reports.yml

This file was deleted.

73 changes: 19 additions & 54 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
name: PR checks
on: pull_request_target
on: pull_request

permissions:
contents: read

jobs:

commits:
permissions:
pull-requests: read # to get list of commits from the PR
name: Canonical CLA signed and Signed-off-by (DCO)
runs-on: ubuntu-latest
steps:
- name: Check if CLA signed
uses: canonical/has-signed-canonical-cla@v1
- name: Get PR Commits
id: 'get-pr-commits'
uses: tim-actions/get-pr-commits@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check that all commits are signed-off
uses: tim-actions/dco@master
with:
commits: ${{ steps.get-pr-commits.outputs.commits }}

lint-scss:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -138,56 +156,3 @@ jobs:

- name: Run Javascript tests
run: dotrun test-js

publish_report:
permissions:
contents: write
name: publish-e2e-report
# if job is cancelled we should skip this
if: success() || needs.e2e.outputs.job_status == 'failure'
needs: [e2e]
runs-on: ubuntu-latest
continue-on-error: true
env:
HTML_REPORT_URL_PATH: reports/pr-${{ github.event.number }}/${{ github.run_id }}/${{ github.run_attempt }}
PR_NUMBER: ${{ github.event.number }}
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
token: ${{ secrets.GITHUB_TOKEN }}
# user git configs are needed for git commands to work
# actual authentication is done using secrets.GITHUB_TOKEN with write permission
- name: Set Git User
run: |
git config --global user.email "github-action@example.com"
git config --global user.name "GitHub Action"
- name: Download zipped HTML report
uses: actions/download-artifact@v4
with:
name: playwright-report
path: ${{ env.HTML_REPORT_URL_PATH }}
- name: Push HTML Report
timeout-minutes: 3
run: |
git add .
git commit -m "workflow: add HTML report for PR #$PR_NUMBER (run_id: ${{ github.run_id }}, attempt: ${{ github.run_attempt }})"

# In case if another action job pushed to gh-pages while we are rebasing for the current job
while true; do
git pull --rebase
if [ $? -ne 0 ]; then
echo "Failed to rebase. Please review manually."
exit 1
fi

git push
if [ $? -eq 0 ]; then
echo "Successfully pushed HTML report to repo."
exit 0
fi
done
- name: Output Report URL as Worfklow Annotation
run: |
FULL_HTML_REPORT_URL=https://canonical.github.io/lxd-ui/$HTML_REPORT_URL_PATH
echo "::notice title=Published Playwright Test Report::$FULL_HTML_REPORT_URL"
28 changes: 14 additions & 14 deletions src/components/ConfigurationRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,20 +135,20 @@ export const getConfigurationRow = ({
override: isReadOnly
? overrideValue
: isOverridden
? getForm()
: wrapDisabledTooltip(
<Button
onClick={toggleDefault}
className="u-no-margin--bottom"
type="button"
disabled={disabled}
appearance="base"
title="Create override"
hasIcon
>
<Icon name="edit" />
</Button>,
),
? getForm()
: wrapDisabledTooltip(
<Button
onClick={toggleDefault}
className="u-no-margin--bottom"
type="button"
disabled={disabled}
appearance="base"
title="Create override"
hasIcon
>
<Icon name="edit" />
</Button>,
),
});
};

Expand Down
4 changes: 2 additions & 2 deletions src/pages/networks/NetworkDetailHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ const NetworkDetailHeader: FC<Props> = ({ name, network, project }) => {
!isManaged
? "Can not rename, network is not managed"
: isUsed
? "Can not rename, network is currently in use."
: undefined
? "Can not rename, network is currently in use."
: undefined
}
controls={
network && <DeleteNetworkBtn network={network} project={project} />
Expand Down
4 changes: 2 additions & 2 deletions src/pages/networks/actions/DeleteNetworkBtn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ const DeleteNetworkBtn: FC<Props> = ({ network, project }) => {
!isManaged
? "Can not delete, network is not managed"
: isUsed
? "Can not delete, network is currently in use"
: "Delete network"
? "Can not delete, network is currently in use"
: "Delete network"
}
confirmationModalProps={{
title: "Confirm delete",
Expand Down
4 changes: 2 additions & 2 deletions src/pages/storage/forms/StoragePoolFormMain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ const StoragePoolFormMain: FC<Props> = ({ formik }) => {
!formik.values.isCreating
? "Driver can't be changed"
: formik.values.driver === zfsDriver
? "ZFS gives best performance and reliability"
: undefined
? "ZFS gives best performance and reliability"
: undefined
}
label="Driver"
options={storageDrivers}
Expand Down
12 changes: 6 additions & 6 deletions src/util/usedBy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ export const filterUsedByType = (
return a.project < b.project
? -1
: a.project > b.project
? 1
: a.name < b.name
? -1
: a.name > b.name
? 1
: 0;
? 1
: a.name < b.name
? -1
: a.name > b.name
? 1
: 0;
}) ?? []
);
};
Expand Down
Loading