Skip to content

ci(devel-crossaction): add python install (3) #6

ci(devel-crossaction): add python install (3)

ci(devel-crossaction): add python install (3) #6

---
# https://github.com/marketplace/actions/cross-platform-action
name: default-crossaction
on:
push:
pull_request:
workflow_dispatch:
permissions: {}
jobs:
test:
permissions:
contents: read
runs-on: ${{ matrix.os.host }}
continue-on-error: ${{ matrix.os.experimental }}
strategy:
matrix:
os:
- name: freebsd
architecture: x86-64
version: '13.2'
host: ubuntu-latest
experimental: true
- name: openbsd
architecture: arm64
version: '7.3'
host: ubuntu-latest
experimental: true
- name: netbsd
architecture: x86-64
version: '9.3'
host: ubuntu-latest
experimental: true
steps:
- uses: actions/checkout@v3
with:
path: ${{ env.ANSIBLE_ROLE }}
- name: Test on ${{ matrix.os.name }}
uses: cross-platform-actions/action@6e970dd060e5c52887de47775b3cf2079aae0c69
env:
ANSIBLE_CALLBACKS_ENABLED: profile_tasks
ANSIBLE_ROLE: juju4.adduser
ANSIBLE_EXTRA_VARS: ''
ANSIBLE_FORCE_COLOR: '1'
PY_COLORS: '1'
with:
environment_variables: ANSIBLE_CALLBACKS_ENABLED ANSIBLE_ROLE ANSIBLE_EXTRA_VARS ANSIBLE_FORCE_COLOR PY_COLORS
operating_system: ${{ matrix.os.name }}
architecture: ${{ matrix.os.architecture }}
version: ${{ matrix.os.version }}
shell: bash
memory: 5G
cpu_count: 4
run: |
set -x
whoami
# freebsd
sudo env ASSUME_ALWAYS_YES=YES pkg bootstrap || true
sudo pkg install -y python3 || true
sudo pkg info || true
# netbsd
export PATH="/usr/pkg/sbin:/usr/pkg/bin:$PATH"
export PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages"
export PKG_PATH="$PKG_PATH/OPSYS/ARCH/VERSIONS/All/"
sudo pkg_add pkgin || true
sudo pkgin -y install python311 || true
# openbsd
doas pkg_add -rIvx python3 || true
python3 --version
python3 -m pip install --upgrade pip
pip install molecule molecule-plugins docker ansible-lint flake8 testinfra ansible
mkdir -p $HOME/.ansible/roles && ln -s $GITHUB_WORKSPACE/$ANSIBLE_ROLE $HOME/.ansible/roles/
ansible --version
ansible-config dump --only-changed -t all
uname -a
pwd
env
cd $GITHUB_WORKSPACE/$ANSIBLE_ROLE && ansible-galaxy install --timeout 120 --verbose -r molecule/default/requirements.yml
cd $GITHUB_WORKSPACE/$ANSIBLE_ROLE && ansible-playbook -i localhost, --connection=local --become -vvv molecule/default/converge.yml ${ANSIBLE_EXTRA_VARS}
cd $GITHUB_WORKSPACE/$ANSIBLE_ROLE && ansible-playbook -i localhost, --connection=local --become -vvv molecule/default/converge.yml ${ANSIBLE_EXTRA_VARS} | tee /tmp/idempotency.log | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && cat /tmp/idempotency.log && exit 0)