Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
holmanb committed Apr 1, 2024
1 parent 51ddaf9 commit 270d189
Showing 1 changed file with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions .github/workflows/alpine-unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,16 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code

- name: "Checkout"
uses: actions/checkout@v4
with:
# Fetch all tags for tools/read-version
fetch-depth: 0

- name: Collect debugging info
run: |
set
- name: Install incus
run: |
Expand All @@ -38,16 +46,28 @@ jobs:
sudo ip link set incusbr0 up
- name: Create alpine container
run: sudo sg incus-admin -c 'incus launch images:alpine/edge alpine'

- name: Check networking (for debugging)
run: |
env
set
sudo sg incus-admin -c 'incus launch images:alpine/edge alpine'
sudo sg incus-admin -c 'incus exec alpine -- ping -c 1 google.com || true'
sudo sg incus-admin -c 'incus exec alpine -- ping -c 1 dl-cdn.alpinelinux.org || true'
sudo sg incus-admin -c 'incus exec alpine -- nslookup www.google.com || true'
sudo sg incus-admin -c 'incus exec alpine -- ping -c 1 dl-cdn.alpinelinux.org || true'
sudo sg incus-admin -c 'incus exec alpine -- apk add py3-tox git'
sudo sg incus-admin -c "incus exec alpine -- git clone --branch ${GITHUB_HEAD_REF} https://github.com/${GITHUB_REPOSITORY}.git"
sudo sg incus-admin -c "incus exec alpine -- cd cloud-init && git fetch origin +refs/pull/*:refs/remotes/origin/pr/*"
sudo sg incus-admin -c "incus exec alpine -- cd cloud-init && git checkout origin/pr/${GITHUB_REF_NAME}"
sudo sg incus-admin -c 'incus exec alpine -- tox -e py3 --root ~/cloud-init'
- name: Install dependencies
run: sudo sg incus-admin -c 'incus exec alpine -- apk add py3-tox'

- name: Mount source into container directory
run: sudo sg incus-admin -c 'incus config device add alpine gitdir disk source=$(pwd) path=/root/cloud-init'

- name: Did the code work?
run: |
sudo sg incus-admin -c 'incus exec alpine -- ls -la /root/'
sudo sg incus-admin -c 'incus exec alpine -- ls -la /root/cloud-init'
sudo sg incus-admin -c 'incus exec alpine -- cd /root/cloud-init && tox -e py3'
# - name: Git the code
# run: |
# sudo sg incus-admin -c "incus exec alpine -- git clone https://github.com/${GITHUB_REPOSITORY}.git"
# sudo sg incus-admin -c 'incus exec alpine --cwd /root/cloud-init/ -- git fetch origin +refs/pull/*:refs/remotes/origin/pr/*'
# sudo sg incus-admin -c "incus exec alpine --cwd /root/cloud-init/ -- git checkout origin/pr/${GITHUB_REF_NAME}"

0 comments on commit 270d189

Please sign in to comment.