Skip to content

test: introduce new uds task file & ci structure #2

test: introduce new uds task file & ci structure

test: introduce new uds task file & ci structure #2

name: Build and test capability
on:
pull_request:
paths:
- "capabilities/**"
permissions:
contents: read
# Abort prior jobs in the same workflow / PR
concurrency:
group: e2e-bb-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Setup golang
uses: ./.github/actions/golang
- name: Build Zarf binary
uses: ./.github/actions/packages
with:
init-package: "false"
build-examples: "false"
- name: Login to Iron Bank
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
if: ${{ env.IRONBANK_USERNAME != '' }}
env:
IRONBANK_USERNAME: ${{ secrets.IRONBANK_USERNAME }}
with:
registry: registry1.dso.mil
username: ${{ secrets.IRONBANK_USERNAME }}
password: ${{ secrets.IRONBANK_PASSWORD }}
- name: Build a registry1.dso.mil Zarf 'init' package
if: ${{ env.IRONBANK_USERNAME != '' }}
env:
IRONBANK_USERNAME: ${{ secrets.IRONBANK_USERNAME }}
run: make ib-init-package
# Upload the contents of the build directory for later stages to use
- name: Upload build artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: build-artifacts
path: build/
retention-days: 1
validate:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Download build artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: build-artifacts
path: build/
- name: Setup golang
uses: ./.github/actions/golang
- name: Make Zarf executable
run: |
chmod +x build/zarf
# Before we run the tests we need to aggressively cleanup files to reduce disk pressure
- name: Cleanup files
uses: ./.github/actions/cleanup-files
- name: Setup K3d
uses: ./.github/actions/k3d
- name: Login to Iron Bank
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
if: ${{ env.IRONBANK_USERNAME != '' }}
env:
IRONBANK_USERNAME: ${{ secrets.IRONBANK_USERNAME }}
with:
registry: registry1.dso.mil
username: ${{ secrets.IRONBANK_USERNAME }}
password: ${{ secrets.IRONBANK_PASSWORD }}
- name: Run tests
if: ${{ env.IRONBANK_USERNAME != '' }}
env:
IRONBANK_USERNAME: ${{ secrets.IRONBANK_USERNAME }}
run: |
sudo mkdir /mnt/zarf-tmp
sudo chown -R runner:runner /mnt/zarf-tmp
CI=true go test ./src/extensions/bigbang/test -failfast -v -timeout 30m
- name: Save logs
uses: ./.github/actions/save-logs