More single-file and wifi profiles things #1005
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Test Build | |
on: [pull_request] # yamllint disable-line rule:truthy | |
jobs: | |
build: | |
name: Ansible Test Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install dependencies | |
run: sudo apt install python3 | |
- name: Install dependencies | |
run: pip3 install -r requirements.txt --upgrade pip | |
- name: Determine branch name | |
run: | | |
BRANCH="${GITHUB_BASE_REF#refs/heads/}" | |
echo "Building for $BRANCH" | |
echo "BRANCH=$BRANCH" >> "$GITHUB_ENV" | |
- name: Determine changed locations | |
run: | | |
CHANGED_HOSTS=$(git diff --diff-filter=d --name-only "origin/$BRANCH" | grep 'host_vars/' | sed 's/host_vars\/\(.*\)\/.*/\1/' | sort | uniq | sed -z 's/\n/,/g;s/,$//') | |
echo "Building for $CHANGED_HOSTS" | |
echo "CHANGED_HOSTS=$CHANGED_HOSTS" >> "$GITHUB_ENV" | |
CHANGED_LOCATIONS=$(git diff --diff-filter=d --name-only "origin/$BRANCH" | grep 'group_vars/location_' | sed 's/group_vars\/\(.*\)\/.*/\1/' | sort | uniq | sed -z 's/\n/,/g;s/,$//') | |
if [ -z "${CHANGED_LOCATIONS}" ]; then | |
CHANGED_LOCATIONS="sama-core,sama-nord-nf-5ghz,l105-gw" | |
fi | |
echo "Building for $CHANGED_LOCATIONS" | |
echo "CHANGED_LOCATIONS=$CHANGED_LOCATIONS" >> "$GITHUB_ENV" | |
- name: Build changed locations | |
run: | | |
ansible-playbook play.yml --tags image --limit "${CHANGED_HOSTS:+$CHANGED_HOSTS,}$CHANGED_LOCATIONS" | |
- name: Store build output | |
uses: actions/upload-artifact@v1 | |
with: | |
name: ansibleimages | |
path: /tmp/ansible-openwrt/images |