Skip to content

Commit

Permalink
wip22
Browse files Browse the repository at this point in the history
  • Loading branch information
Maciej Golaszewski committed Nov 8, 2024
1 parent 105f5e1 commit ec6abdd
Showing 1 changed file with 56 additions and 66 deletions.
122 changes: 56 additions & 66 deletions .github/workflows/k8s-snap-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,79 +21,69 @@ jobs:
runs-on: ubuntu-20.04

steps:
# - name: Checking out repo
# uses: actions/checkout@v4
# - name: Setup Python
# uses: actions/setup-python@v5
# with:
# python-version: "3.8"
# - name: Install tox
# run: pip install tox
# - name: Install Go
# uses: actions/setup-go@v5
# with:
# go-version: "1.21"
# - name: Download latest k8s-snap
# run: |
# sudo snap download k8s --channel=latest/edge --basename k8s
# - name: Install lxd
# run: |
# sudo snap refresh lxd --channel 5.21/stable
# sudo lxd init --auto
# sudo usermod --append --groups lxd $USER
# sg lxd -c 'lxc version'
# - name: Build k8s-dqlite
# run: |
# make static
# - name: Unpack Snap
# run: |
# sudo unsquashfs -d snap-unpack-dir k8s.snap
# - name: Replace k8s-dqlite binary
# run: |
# sudo cp ./bin/static/k8s-dqlite snap-unpack-dir/bin/k8s-dqlite
# sudo chmod o+r snap-unpack-dir/bin/k8s-dqlite
# - name: Repack Snap
# run: |
# sudo mksquashfs snap-unpack-dir k8s-updated.snap -noappend -comp lzo -no-fragments
- name: Checking out repo
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install tox
run: pip install tox
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Download latest k8s-snap
run: |
sudo snap download k8s --channel=latest/edge --basename k8s
- name: Install lxd
run: |
sudo snap refresh lxd --channel 5.21/stable
sudo lxd init --auto
sudo usermod --append --groups lxd $USER
sg lxd -c 'lxc version'
- name: Build k8s-dqlite
run: |
make static
- name: Unpack Snap
run: |
sudo unsquashfs -d snap-unpack-dir k8s.snap
- name: Replace k8s-dqlite binary
run: |
sudo cp ./bin/static/k8s-dqlite snap-unpack-dir/bin/k8s-dqlite
sudo chmod o+r snap-unpack-dir/bin/k8s-dqlite
- name: Repack Snap
run: |
sudo mksquashfs snap-unpack-dir k8s-updated.snap -noappend -comp lzo -no-fragments
- name: Running
env:
TEST_SNAP: ${{ github.workspace }}/k8s-updated.snap
TEST_SUBSTRATE: lxd
TEST_LXD_IMAGE: ubuntu:22.04
TEST_INSPECTION_REPORTS_DIR: ${{ github.workspace }}/inspection-reports
run: |
echo $TEST_CNCF_E2E
git clone https://github.com/canonical/k8s-snap.git -b KU-1748/optional-cncf-conformance-tests #revert after merging https://github.com/canonical/k8s-snap/pull/715
#git clone https://github.com/canonical/k8s-snap.git
cd k8s-snap/tests/integration && sg lxd -c 'tox -e integration'
- name: Prepare inspection reports
if: failure()
run: |
tar -czvf inspection-reports.tar.gz -C ${{ github.workspace }} inspection-reports
- name: Upload inspection report artifact
if: failure()
uses: actions/upload-artifact@v4
with:
name: inspection-reports
path: ${{ github.workspace }}/inspection-reports.tar.gz
- name: Extract CNCF conformance report
if: ${{ env.TEST_CNCF_E2E == 'true'}}
# working-directory: k8s-snap/tests/integration
if: ${{ failure() && (env.TEST_CNCF_E2E == 'true') }}
working-directory: k8s-snap/tests/integration
run: |
echo "yest=${TEST_CNCF_E2E}"
tar -xf sonobuoy_e2e.tar.gz --one-top-level
- name: Upload CNCF conformance report artifact
uses: actions/upload-artifact@v4
if: ${{ failure() && (env.TEST_CNCF_E2E == 'true') }}
with:
name: report_sonobuoy_e2e
path: k8s-snap/tests/integration/sonobuoy_e2e

# git clone https://github.com/canonical/k8s-snap.git -b KU-1748/optional-cncf-conformance-tests #revert after merging https://github.com/canonical/k8s-snap/pull/715
# #git clone https://github.com/canonical/k8s-snap.git
# cd k8s-snap/tests/integration && sg lxd -c 'tox -e integration'
# - name: Prepare inspection reports
# if: failure()
# run: |
# tar -czvf inspection-reports.tar.gz -C ${{ github.workspace }} inspection-reports
# - name: Upload inspection report artifact
# if: failure()
# uses: actions/upload-artifact@v4
# with:
# name: inspection-reports
# path: ${{ github.workspace }}/inspection-reports.tar.gz
# - name: Extract CNCF conformance report
# if: ${{ failure() && env.TEST_CNCF_E2E }}
# working-directory: k8s-snap/tests/integration
# run: |
# tar -xf sonobuoy_e2e.tar.gz --one-top-level
# - name: Upload CNCF conformance report artifact
# uses: actions/upload-artifact@v4
# if: ${{ failure() && env.TEST_CNCF_E2E }}
# with:
# name: report_sonobuoy_e2e
# path: k8s-snap/tests/integration/sonobuoy_e2e
#

0 comments on commit ec6abdd

Please sign in to comment.