|
98 | 98 | )" >> $GITHUB_OUTPUT |
99 | 99 | if: "${{ github.event.inputs.integ_tests_include || github.event.schedule }}" |
100 | 100 |
|
| 101 | + examples-matrix: |
| 102 | + runs-on: [ ubuntu-latest ] |
| 103 | + container: python:3.10-slim-buster |
| 104 | + env: |
| 105 | + DEBIAN_FRONTEND: noninteractive |
| 106 | + ANSIBLE_COLLECTIONS_PATH: /work-dir |
| 107 | + outputs: |
| 108 | + matrix: ${{ steps.set-matrix.outputs.matrix }} |
| 109 | + steps: |
| 110 | + - name: Checkout |
| 111 | + uses: actions/checkout@v3 |
| 112 | + - run: apt update |
| 113 | + - run: apt install -y jq |
| 114 | + - run: mkdir -p $WORKDIR |
| 115 | + - run: cp -a ./ $WORKDIR |
| 116 | + # A few files are not an example playbook: |
| 117 | + # hypercore_inventory.yml - inventory example |
| 118 | + # cloud-init-user-data-example.yml - cloud-init user-data example |
| 119 | + - id: set-matrix |
| 120 | + shell: bash |
| 121 | + run: |- |
| 122 | + echo "matrix=$( |
| 123 | + ls -r $WORKDIR/examples | |
| 124 | + grep -v -E "^README.md$|^hypercore_inventory.yml$|^cloud-init-user-data-example.yml$" | |
| 125 | + jq -R -s -c 'split("\n")[:-1]' |
| 126 | + )" >> $GITHUB_OUTPUT |
| 127 | + if: "${{ github.event.inputs || github.event.schedule }}" |
| 128 | + |
| 129 | + examples-run: |
| 130 | + needs: |
| 131 | + - examples-matrix |
| 132 | + runs-on: [ self-hosted2 ] |
| 133 | + container: python:3.10-slim-buster |
| 134 | + env: |
| 135 | + DEBIAN_FRONTEND: noninteractive |
| 136 | + strategy: |
| 137 | + fail-fast: false |
| 138 | + matrix: |
| 139 | + ansible: [ 2.13.0 ] |
| 140 | + example_name: ${{ fromJson(needs.examples-matrix.outputs.matrix) }} |
| 141 | + steps: |
| 142 | + - name: Checkout |
| 143 | + uses: actions/checkout@v3 |
| 144 | + - run: pip3 install -r sanity.requirements -r test.requirements -r docs.requirements |
| 145 | + - run: apt update |
| 146 | + - run: apt install -y git make |
| 147 | + - run: apt install -y genisoimage qemu-utils jq |
| 148 | + - run: pip install yq |
| 149 | + - run: pip install ansible-core~=${{ matrix.ansible }} |
| 150 | + - run: mkdir -p $WORKDIR |
| 151 | + - run: cp -a ./ $WORKDIR |
| 152 | + - run: cd $WORKDIR && ansible-galaxy collection install community.crypto community.general |
| 153 | + - run: cd $WORKDIR && ansible-galaxy collection list |
| 154 | + - run: | |
| 155 | + cd $WORKDIR |
| 156 | + echo "${{ vars.CI_CONFIG_HC_IP50 }}" > tests/integration/integration_config.yml |
| 157 | + cat tests/integration/integration_config.yml |
| 158 | + echo "sc_password: ${{ secrets.CI_CONFIG_HC_IP50_SC_PASSWORD }}" >> tests/integration/integration_config.yml |
| 159 | + echo "smb_password: ${{ secrets.CI_CONFIG_HC_IP50_SMB_PASSWORD }}" >> tests/integration/integration_config.yml |
| 160 | + echo "sc_replication_dest_password: ${{ secrets.CI_CONFIG_HC_IP50_SC_REPLICATION_DEST_PASSWORD }}" >> tests/integration/integration_config.yml |
| 161 | + ls -al tests/integration/integration_config.yml |
| 162 | + - run: | |
| 163 | + cd $WORKDIR |
| 164 | + eval export SC_HOST=$(cat tests/integration/integration_config.yml | yq '.sc_host') |
| 165 | + eval export SC_USERNAME=$(cat tests/integration/integration_config.yml | yq '.sc_username') |
| 166 | + eval export SC_PASSWORD=$(cat tests/integration/integration_config.yml | yq '.sc_password') |
| 167 | + eval export SC_TIMEOUT=$(cat tests/integration/integration_config.yml | yq '.sc_timeout') |
| 168 | + ansible-playbook --check examples/${{ matrix.example_name }} |
| 169 | +
|
101 | 170 | integ: |
102 | 171 | needs: |
103 | 172 | - integ-matrix |
@@ -139,6 +208,7 @@ jobs: |
139 | 208 | ls -al tests/integration/integration_config.yml |
140 | 209 | - run: cd $WORKDIR && ansible-test integration --local ${{ matrix.test_name }} |
141 | 210 |
|
| 211 | + |
142 | 212 | replica_cleanup: |
143 | 213 | needs: |
144 | 214 | - integ |
|
0 commit comments