Skip to content

Commit

Permalink
Merge pull request #2570 from reubenmiller/feat-merge-queue
Browse files Browse the repository at this point in the history
ci: enable merge queue
  • Loading branch information
reubenmiller authored Jan 9, 2024
2 parents fda2986 + 8756f06 commit b9a35fc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ on:
# Reference: https://dev.to/petrsvihlik/using-environment-protection-rules-to-secure-secrets-when-building-external-forks-with-pullrequesttarget-hci
pull_request_target:
branches: [ main ]
push:
branches: [ main ]
merge_group:
workflow_dispatch:
inputs:
environment:
Expand Down Expand Up @@ -105,13 +104,23 @@ jobs:
name: packages-${{ matrix.job.target }}
path: target/${{ matrix.job.target }}/packages/*.deb

test:
name: Test ${{ matrix.job.arch }}
approve:
# Note: Use approval as a job so that the downstream jobs are only prompted once (if more than 1 matrix job is defined)
name: Approve
needs: [build]
environment:
# For security reasons, all pull requests need to be approved first before granting access to secrets
# So the environment should be set to have a reviewer/s inspect it before approving it
name: ${{ inputs.environment || 'Test Pull Request' }}
name: ${{ github.event_name == 'pull_request_target' && 'Test Pull Request' || 'Test Auto' }}
runs-on: ubuntu-22.04
steps:
- name: Wait for approval
run: echo "Approved"
test:
name: Test ${{ matrix.job.arch }}
needs: [approve]
environment:
name: Test Auto
runs-on: ubuntu-20.04
strategy:
matrix:
Expand All @@ -120,18 +129,11 @@ jobs:
steps:
# Checkout either the PR or the branch
- name: Checkout PR
if: ${{ github.event.pull_request.head.sha || '' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }} # Check out the code of the PR. Only after the manual approval process
fetch-depth: 0

- name: Checkout
if: ${{ !github.event.pull_request.head.sha }}
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download release artifacts
uses: actions/download-artifact@v4
with:
Expand All @@ -143,7 +145,6 @@ jobs:
run: |
touch .env
echo 'C8Y_BASEURL="${{ secrets.C8Y_BASEURL }}"' >> .env
echo 'C8Y_TENANT="${{ secrets.C8Y_TENANT }}"' >> .env
echo 'C8Y_USER="${{ secrets.C8Y_USER }}"' >> .env
echo 'C8Y_PASSWORD="${{ secrets.C8Y_PASSWORD }}"' >> .env
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Pull Request Checks
on:
workflow_dispatch:
pull_request:

merge_group:
env:
CARGO_TERM_COLOR: always

Expand Down
1 change: 0 additions & 1 deletion tests/RobotFramework/devdata/env.template
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
#
C8Y_BASEURL=
C8Y_USER=
C8Y_TENANT=
C8Y_PASSWORD=

#
Expand Down
2 changes: 1 addition & 1 deletion tests/RobotFramework/resources/common.resource
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ ${DEVICE_ADAPTER} %{DEVICE_ADAPTER=docker}
&{LOCAL_CONFIG} skip_bootstrap=False bootstrap_script=%{LOCAL_CONFIG_BOOTSTRAP_SCRIPT= }

# Cumulocity settings
&{C8Y_CONFIG} host=%{C8Y_BASEURL= } username=%{C8Y_USER= } password=%{C8Y_PASSWORD= } tenant=%{C8Y_TENANT= }
&{C8Y_CONFIG} host=%{C8Y_BASEURL= } username=%{C8Y_USER= } password=%{C8Y_PASSWORD= }

0 comments on commit b9a35fc

Please sign in to comment.