Skip to content

Commit

Permalink
Add some ARM 64 tests (#222)
Browse files Browse the repository at this point in the history
* Try to add some ARM 64 tests.

* Some some basic info on system.

* Use slightly different versions on non-x86 architectures.
  • Loading branch information
felixfontein authored Feb 9, 2025
1 parent aac62ca commit 97e6ff2
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 85 deletions.
31 changes: 29 additions & 2 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
runs-on: >-
${{ contains(fromJson(
'["stable-2.9", "stable-2.10", "stable-2.11"]'
), matrix.ansible) && 'ubuntu-20.04' || 'ubuntu-latest' }}
), matrix.ansible) && 'ubuntu-20.04' || matrix.gha_container || 'ubuntu-latest' }}
permissions:
contents: read
strategy:
Expand All @@ -77,6 +77,8 @@ jobs:
- 3.9.3
python_version:
- ''
gha_container:
- ''
include:
# 2.15
- ansible: stable-2.15
Expand Down Expand Up @@ -128,6 +130,11 @@ jobs:
docker_container: quay.io/ansible-community/test-image:debian-bullseye
python_version: '3.9'
sops_version: latest
# ARM 64
- ansible: devel
docker_container: ubuntu2404
sops_version: latest
gha_container: ubuntu-24.04-arm
steps:
- name: >-
Perform integration testing against
Expand Down Expand Up @@ -162,7 +169,7 @@ jobs:
runs-on: >-
${{ contains(fromJson(
'["stable-2.9", "stable-2.10", "stable-2.11"]'
), matrix.ansible) && 'ubuntu-20.04' || 'ubuntu-latest' }}
), matrix.ansible) && 'ubuntu-20.04' || matrix.gha_container || 'ubuntu-latest' }}
permissions:
contents: read
strategy:
Expand All @@ -179,6 +186,8 @@ jobs:
- ''
github_latest_detection:
- ''
gha_container:
- ''
exclude:
- docker_container: ''
include:
Expand Down Expand Up @@ -242,6 +251,24 @@ jobs:
target: gha/install/3/
github_latest_detection: auto
test-deps: git+https://github.com/ansible-collections/community.general.git,main
# ARM 64
- ansible: devel
docker_container: fedora41
python_version: ''
target: gha/install/1/
gha_container: ubuntu-24.04-arm
- ansible: devel
docker_container: ubuntu2204
python_version: ''
target: gha/install/2/
gha_container: ubuntu-24.04-arm
- ansible: devel
docker_container: alpine321
python_version: ''
target: gha/install/3/
github_latest_detection: auto
test-deps: git+https://github.com/ansible-collections/community.general.git,main
gha_container: ubuntu-24.04-arm
steps:
- name: >-
Perform sops installation integration testing against
Expand Down
8 changes: 8 additions & 0 deletions tests/integration/targets/role_install_latest/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

- name: Show some basic system info
debug:
msg: |
Architecture: {{ ansible_architecture }}
OS family: {{ ansible_os_family }}
Distribution: {{ ansible_distribution }}
Distribution version: {{ ansible_distribution_version }}
- name: Install latest sops
include_role:
name: community.sops.install
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,49 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

- name: Install sops 3.7.3 on localhost
include_role:
name: community.sops.install
vars:
sops_version: 3.7.3
sops_install_on_localhost: true
sops_github_token: "{{ github_token | default('') | string }}"
- name: Show some basic system info
debug:
msg: |
Architecture: {{ ansible_architecture }}
OS family: {{ ansible_os_family }}
Distribution: {{ ansible_distribution }}
Distribution version: {{ ansible_distribution_version }}
- name: Install sops 3.7.0 on remote
include_role:
name: community.sops.install
vars:
sops_version: 3.7.0
sops_install_on_localhost: false
sops_github_token: "{{ github_token | default('') | string }}"
- vars:
sops_version_1: "{{ '3.7.3' if ansible_architecture == 'x86_64' else '3.9.2' }}"
sops_version_2: "{{ '3.7.0' if ansible_architecture == 'x86_64' else '3.8.1' }}"
block:
- name: Install sops {{ sops_version_1 }} on localhost
include_role:
name: community.sops.install
vars:
sops_version: "{{ sops_version_1 }}"
sops_install_on_localhost: true
sops_github_token: "{{ github_token | default('') | string }}"

- name: Figure out sops version on localhost
command:
cmd: sops --version
delegate_to: localhost
register: output_localhost
- name: Install sops {{ sops_version_2 }} on remote
include_role:
name: community.sops.install
vars:
sops_version: "{{ sops_version_2 }}"
sops_install_on_localhost: false
sops_github_token: "{{ github_token | default('') | string }}"

- name: Figure out sops version on remote host
command:
cmd: sops --version
register: output_remote
- name: Figure out sops version on localhost
command:
cmd: sops --version
delegate_to: localhost
register: output_localhost

- name: Check sops version
assert:
that:
- >-
'sops 3.7.3' in output_localhost.stdout
- >-
'sops 3.7.0' in output_remote.stdout
- name: Figure out sops version on remote host
command:
cmd: sops --version
register: output_remote

- name: Check sops version
assert:
that:
- >-
('sops ' ~ sops_version_1) in output_localhost.stdout
- >-
('sops ' ~ sops_version_2) in output_remote.stdout
119 changes: 66 additions & 53 deletions tests/integration/targets/role_install_version/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,69 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

- name: Install sops 3.7.3
include_role:
name: community.sops.install
vars:
sops_version: 3.7.3
sops_github_token: "{{ github_token | default('') | string }}"

- name: Figure out sops version
command:
cmd: sops --version
register: output

- name: Check sops version
assert:
that:
- >-
'sops 3.7.3' in output.stdout
- name: Install sops 3.7.0
include_role:
name: community.sops.install
vars:
sops_version: 3.7.0
sops_github_token: "{{ github_token | default('') | string }}"

- name: Figure out sops version
command:
cmd: sops --version
register: output

- name: Check sops version
assert:
that:
- >-
'sops 3.7.0' in output.stdout
- name: Install sops 3.8.0-rc.1
include_role:
name: community.sops.install
vars:
sops_version: 3.8.0-rc.1
sops_github_token: "{{ github_token | default('') | string }}"

- name: Figure out sops version
command:
cmd: sops --version --disable-version-check
register: output

- name: Check sops version
assert:
that:
- >-
'sops 3.8.0-rc.1' == output.stdout
- name: Show some basic system info
debug:
msg: |
Architecture: {{ ansible_architecture }}
OS family: {{ ansible_os_family }}
Distribution: {{ ansible_distribution }}
Distribution version: {{ ansible_distribution_version }}
- vars:
sops_version_1: "{{ '3.7.3' if ansible_architecture == 'x86_64' else '3.9.2' }}"
sops_version_2: "{{ '3.7.0' if ansible_architecture == 'x86_64' else '3.8.1' }}"
sops_version_3: 3.8.0-rc.1
block:
- name: Install sops {{ sops_version_1 }}
include_role:
name: community.sops.install
vars:
sops_version: "{{ sops_version_1 }}"
sops_github_token: "{{ github_token | default('') | string }}"

- name: Figure out sops version
command:
cmd: sops --version
register: output

- name: Check sops version
assert:
that:
- >-
('sops ' ~ sops_version_1) in output.stdout
- name: Install sops {{ sops_version_2 }}
include_role:
name: community.sops.install
vars:
sops_version: "{{ sops_version_2 }}"
sops_github_token: "{{ github_token | default('') | string }}"

- name: Figure out sops version
command:
cmd: sops --version
register: output

- name: Check sops version
assert:
that:
- >-
('sops ' ~ sops_version_2) in output.stdout
- name: Install sops {{ sops_version_3 }}
include_role:
name: community.sops.install
vars:
sops_version: "{{ sops_version_3 }}"
sops_github_token: "{{ github_token | default('') | string }}"

- name: Figure out sops version
command:
cmd: sops --version --disable-version-check
register: output

- name: Check sops version
assert:
that:
- >-
('sops ' ~ sops_version_3) == output.stdout
8 changes: 8 additions & 0 deletions tests/integration/targets/setup_sops/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

- name: Show some basic system info
debug:
msg: |
Architecture: {{ ansible_architecture }}
OS family: {{ ansible_os_family }}
Distribution: {{ ansible_distribution }}
Distribution version: {{ ansible_distribution_version }}
- name: Install sops on localhost
include_role:
name: community.sops.install
Expand Down
8 changes: 8 additions & 0 deletions tests/integration/targets/setup_sops/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

- name: Show some basic system info
debug:
msg: |
Architecture: {{ ansible_architecture }}
OS family: {{ ansible_os_family }}
Distribution: {{ ansible_distribution }}
Distribution version: {{ ansible_distribution_version }}
- name: Test whether sops is installed
command: sops --help
failed_when: false
Expand Down

0 comments on commit 97e6ff2

Please sign in to comment.