mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-22 05:09:12 +00:00
[PR #11546/b2476039 backport][stable-10] [stable-11] Update tests to pass on macOS arm64 (#11544) (#11595)
[stable-11] Update tests to pass on macOS arm64 (#11544) (#11546) Update tests to pass on macOS arm64 (#11544) (cherry picked from commit9b9d8eac09) (cherry picked from commitb247603961) Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Matt Clay <matt@mystile.com>
This commit is contained in:
parent
09037c0e0f
commit
82e771cd25
6 changed files with 31 additions and 13 deletions
|
|
@ -52,9 +52,11 @@
|
||||||
- name: Symlink java
|
- name: Symlink java
|
||||||
become: true
|
become: true
|
||||||
file:
|
file:
|
||||||
src: "/usr/local/opt/openjdk@17/libexec/openjdk.jdk"
|
src: "{{ brew_prefix }}/opt/openjdk@17/libexec/openjdk.jdk"
|
||||||
dest: "/Library/Java/JavaVirtualMachines/openjdk-17.jdk"
|
dest: "/Library/Java/JavaVirtualMachines/openjdk-17.jdk"
|
||||||
state: link
|
state: link
|
||||||
|
vars:
|
||||||
|
brew_prefix: "{{ lookup('pipe', 'brew --prefix') }}"
|
||||||
when:
|
when:
|
||||||
- ansible_os_family == 'Darwin'
|
- ansible_os_family == 'Darwin'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,11 @@
|
||||||
dest: "{{ launchd_plist_location }}"
|
dest: "{{ launchd_plist_location }}"
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
|
- name: ensure target directory exists
|
||||||
|
file:
|
||||||
|
path: /usr/local/sbin
|
||||||
|
state: directory
|
||||||
|
|
||||||
- name: install the test daemon script
|
- name: install the test daemon script
|
||||||
copy:
|
copy:
|
||||||
src: ansible_test_service.py
|
src: ansible_test_service.py
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,9 @@
|
||||||
- include_tasks: run.yml
|
- include_tasks: run.yml
|
||||||
vars:
|
vars:
|
||||||
nodejs_version: '{{ item }}'
|
nodejs_version: '{{ item }}'
|
||||||
nodejs_path: 'node-v{{ nodejs_version }}-{{ ansible_system|lower }}-x{{ ansible_userspace_bits }}'
|
nodejs_path: 'node-v{{ nodejs_version }}-{{ ansible_facts.system|lower }}-{{ nodejs_arch }}'
|
||||||
|
nodejs_arch: '{{ "x64" if ansible_architecture == "x86_64" else "arm64" if ansible_architecture in ("arm64", "aarch64") else ansible_architecture }}'
|
||||||
|
nodejs_ext: '{{ ".tar.xz" if ansible_system == "Linux" else ".tar.gz" }}'
|
||||||
|
nodejs_download: 'https://nodejs.org/dist/v{{ nodejs_version }}/{{ nodejs_path }}{{ nodejs_ext }}'
|
||||||
with_items:
|
with_items:
|
||||||
- 7.10.1 # provides npm 4.2.0 (last npm < 5 released)
|
- 16.20.2 # oldest node version with macOS arm64 support
|
||||||
- 8.0.0 # provides npm 5.0.0
|
|
||||||
- 8.2.0 # provides npm 5.3.0 (output change with this version)
|
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,13 @@
|
||||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# 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
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- name: 'Download NPM'
|
- name: Show Node.js Download URL
|
||||||
|
debug:
|
||||||
|
var: nodejs_download
|
||||||
|
|
||||||
|
- name: Download Node.js
|
||||||
unarchive:
|
unarchive:
|
||||||
src: 'https://ansible-ci-files.s3.amazonaws.com/test/integration/targets/npm/{{ nodejs_path }}.tar.gz'
|
src: '{{ nodejs_download }}'
|
||||||
dest: '{{ remote_tmp_dir }}'
|
dest: '{{ remote_tmp_dir }}'
|
||||||
remote_src: true
|
remote_src: true
|
||||||
creates: '{{ remote_tmp_dir }}/{{ nodejs_path }}.tar.gz'
|
creates: '{{ remote_tmp_dir }}/{{ nodejs_path }}.tar.gz'
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,12 @@
|
||||||
- include_tasks: run.yml
|
- include_tasks: run.yml
|
||||||
vars:
|
vars:
|
||||||
nodejs_version: '{{ item.node_version }}'
|
nodejs_version: '{{ item.node_version }}'
|
||||||
nodejs_path: 'node-v{{ nodejs_version }}-{{ ansible_system|lower }}-x{{ ansible_userspace_bits }}'
|
nodejs_path: 'node-v{{ nodejs_version }}-{{ ansible_facts.system|lower }}-{{ nodejs_arch }}'
|
||||||
|
nodejs_arch: '{{ "x64" if ansible_architecture == "x86_64" else "arm64" if ansible_architecture in ("arm64", "aarch64") else ansible_architecture }}'
|
||||||
|
nodejs_ext: '{{ ".tar.xz" if ansible_system == "Linux" else ".tar.gz" }}'
|
||||||
|
nodejs_download: 'https://nodejs.org/dist/v{{ nodejs_version }}/{{ nodejs_path }}{{ nodejs_ext }}'
|
||||||
yarn_version: '{{ item.yarn_version }}'
|
yarn_version: '{{ item.yarn_version }}'
|
||||||
with_items:
|
with_items:
|
||||||
- {node_version: 4.8.0, yarn_version: 1.6.0} # Lowest compatible nodejs version
|
- {node_version: 16.20.2, yarn_version: 1.22.22} # oldest node version with macOS arm64 support
|
||||||
- {node_version: 8.0.0, yarn_version: 1.6.0}
|
|
||||||
when:
|
when:
|
||||||
- not (ansible_os_family == 'Alpine') # TODO
|
- not (ansible_os_family == 'Alpine') # TODO
|
||||||
|
|
|
||||||
|
|
@ -8,16 +8,20 @@
|
||||||
path: /usr/local/lib/nodejs
|
path: /usr/local/lib/nodejs
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: 'Download Nodejs'
|
- name: Show Node.js Download URL
|
||||||
|
debug:
|
||||||
|
var: nodejs_download
|
||||||
|
|
||||||
|
- name: Download Node.js
|
||||||
unarchive:
|
unarchive:
|
||||||
src: 'https://ansible-ci-files.s3.amazonaws.com/test/integration/targets/yarn/{{ nodejs_path }}.tar.gz'
|
src: '{{ nodejs_download }}'
|
||||||
dest: '{{ remote_tmp_dir }}'
|
dest: '{{ remote_tmp_dir }}'
|
||||||
remote_src: true
|
remote_src: true
|
||||||
creates: '{{ remote_tmp_dir }}/{{ nodejs_path }}.tar.gz'
|
creates: '{{ remote_tmp_dir }}/{{ nodejs_path }}.tar.gz'
|
||||||
|
|
||||||
- name: 'Download Yarn'
|
- name: 'Download Yarn'
|
||||||
unarchive:
|
unarchive:
|
||||||
src: 'https://ansible-ci-files.s3.amazonaws.com/test/integration/targets/yarn/yarn-v{{yarn_version}}.tar.gz'
|
src: 'https://github.com/yarnpkg/yarn/releases/download/v{{yarn_version}}/yarn-v{{yarn_version}}.tar.gz'
|
||||||
dest: '{{ remote_tmp_dir }}'
|
dest: '{{ remote_tmp_dir }}'
|
||||||
remote_src: true
|
remote_src: true
|
||||||
creates: '{{ remote_tmp_dir }}/yarn-v{{yarn_version}}_pkg.tar.gz'
|
creates: '{{ remote_tmp_dir }}/yarn-v{{yarn_version}}_pkg.tar.gz'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue