github: add testing of opensuse builds #192
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: Samba Container Image CI | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
schedule: | |
- cron: '0 2 * * *' | |
env: | |
CONTAINER_CMD: docker | |
jobs: | |
checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# We need a newer version of shellcheck to avoid problems with the | |
# relative imports. Our scripts work on v0.7.2 and up but not the | |
# v0.7.0 preinstalled in the ubutnu image. We can force a local | |
# install by expliclity setting SHELLCHECK to `$ALT_BIN/shellcheck` | |
- name: Run static check tools | |
run: make check SHELLCHECK=$PWD/.bin/shellcheck | |
check-commits: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Ensure branches | |
run: git fetch | |
- name: Lint git commit messages | |
run: make check-gitlint | |
build-server: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: [centos, fedora, opensuse] | |
arch: [amd64] | |
env: | |
BUILDAH_FORMAT: oci | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build the server image | |
run: make OS_NAME=${{ matrix.os}} BUILD_ARCH=${{ matrix.arch}} build-server | |
- name: Upload server image | |
uses: ishworkh/docker-image-artifact-upload@v1 | |
with: | |
image: "samba-server:${{ matrix.os }}-latest" | |
retention_days: 1 | |
build-ad-server: | |
strategy: | |
matrix: | |
os: [centos, fedora, opensuse] | |
arch: [amd64] | |
exclude: | |
- os: centos | |
runs-on: ubuntu-latest | |
env: | |
BUILDAH_FORMAT: oci | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build the ad server image | |
run: make OS_NAME=${{matrix.os}} BUILD_ARCH=${{matrix.arch}} build-ad-server | |
- name: Upload ad server image | |
uses: ishworkh/docker-image-artifact-upload@v1 | |
with: | |
image: "samba-ad-server:${{ matrix.os}}-latest" | |
retention_days: 1 | |
build-client: | |
strategy: | |
matrix: | |
os: [centos, fedora, opensuse] | |
arch: [amd64] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: build the client image | |
run: make OS_NAME=${{ matrix.os }} BUILD_ARCH=${{ matrix.arch }} build-client | |
# Here we upload samba-client image to artifacts locally for consumption | |
# during the samba-toolbox build process. | |
- name: Upload the client image | |
uses: ishworkh/docker-image-artifact-upload@v1 | |
with: | |
image: "quay.io/samba.org/samba-client:${{ matrix.os }}-latest" | |
retention_days: 1 | |
build-toolbox: | |
strategy: | |
matrix: | |
os: [centos, fedora, opensuse] | |
arch: [amd64] | |
needs: build-client | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# Download locally stored samba-client image to be used as base for building | |
# samba-toolbox. | |
- name: Download client image | |
uses: ishworkh/docker-image-artifact-download@v1 | |
with: | |
image: "quay.io/samba.org/samba-client:${{ matrix.os }}-latest" | |
- name: Build the toolbox image | |
run: make OS_NAME=${{ matrix.os }} BUILD_ARCH=${{ matrix.arch }} build-toolbox | |
test-server: | |
strategy: | |
matrix: | |
os: [centos, fedora, opensuse] | |
arch: [amd64] | |
needs: build-server | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download server image | |
uses: ishworkh/docker-image-artifact-download@v1 | |
with: | |
image: "samba-server:${{ matrix.os }}-latest" | |
- name: Test the server image | |
run: LOCAL_TAG="samba-server:${{ matrix.os}}-latest" tests/test-samba-container.sh | |
# Reminder: the nightly-server images consume nightly samba rpm builds | |
# it is not *just* an image that gets built nightly | |
build-nightly-server: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: [centos, fedora] | |
arch: [amd64] | |
env: | |
BUILDAH_FORMAT: oci | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build the nightly server image | |
run: make OS_NAME=${{ matrix.os }} BUILD_ARCH=${{ matrix.arch }} build-nightly-server | |
- name: Upload nightly server image | |
uses: ishworkh/docker-image-artifact-upload@v1 | |
with: | |
image: "samba-server:${{ matrix.os }}-nightly" | |
retention_days: 1 | |
build-nightly-ad-server: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: [centos, fedora] | |
arch: [amd64] | |
exclude: | |
- os: centos | |
env: | |
BUILDAH_FORMAT: oci | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build the nightly ad server image | |
run: make OS_NAME=${{ matrix.os }} BUILD_ARCH=${{ matrix.arch }} build-nightly-ad-server | |
- name: Upload nightly AD server image | |
uses: ishworkh/docker-image-artifact-upload@v1 | |
with: | |
image: "samba-ad-server:${{ matrix.os }}-nightly" | |
retention_days: 1 | |
test-nightly-server: | |
strategy: | |
matrix: | |
os: [centos, fedora] | |
arch: [amd64] | |
needs: build-nightly-server | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download nightly server image | |
uses: ishworkh/docker-image-artifact-download@v1 | |
with: | |
image: "samba-server:${{ matrix.os }}-nightly" | |
- name: Test the nightly server image | |
run: LOCAL_TAG=samba-server:${{ matrix.os }}-nightly tests/test-samba-container.sh | |
test-ad-server-kubernetes: | |
strategy: | |
matrix: | |
os: [centos, fedora, opensuse] | |
arch: [amd64] | |
exclude: | |
- os: centos | |
needs: | |
- build-ad-server | |
- build-server | |
# need to explicitly use 20.04 to avoid problems with jq... | |
runs-on: ubuntu-20.04 | |
env: | |
IMG_TAG: ${{ matrix.os }}-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: nolar/setup-k3d-k3s@v1 | |
- name: get nodes | |
run: kubectl get nodes | |
- name: Download ad server image | |
uses: ishworkh/docker-image-artifact-download@v1 | |
with: | |
image: "samba-ad-server:${{ matrix.os }}-latest" | |
- name: import ad server image | |
run: k3d image import samba-ad-server:${{ matrix.os }}-latest | |
- name: Download file server image | |
uses: ishworkh/docker-image-artifact-download@v1 | |
with: | |
image: "samba-server:${{ matrix.os }}-latest" | |
- name: import file server image | |
run: k3d image import samba-server:${{ matrix.os }}-latest | |
- name: run the ad-dc deployment test | |
run: ./tests/test-samba-ad-server-kubernetes.sh | |
test-nightly-ad-server-kubernetes: | |
strategy: | |
matrix: | |
os: [centos, fedora] | |
arch: [amd64] | |
exclude: | |
- os: centos | |
needs: | |
- build-nightly-server | |
- build-nightly-ad-server | |
# need to explicitly use 20.04 to avoid problems with jq... | |
runs-on: ubuntu-20.04 | |
env: | |
IMG_TAG: ${{ matrix.os }}-nightly | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: nolar/setup-k3d-k3s@v1 | |
- name: get nodes | |
run: kubectl get nodes | |
- name: Download nightly ad server image | |
uses: ishworkh/docker-image-artifact-download@v1 | |
with: | |
image: "samba-ad-server:${{ matrix.os }}-nightly" | |
- name: import nightly ad server image | |
run: k3d image import samba-ad-server:${{ matrix.os }}-nightly | |
- name: Download nightly file server image | |
uses: ishworkh/docker-image-artifact-download@v1 | |
with: | |
image: "samba-server:${{ matrix.os }}-nightly" | |
- name: import nightly file server image | |
run: k3d image import samba-server:${{ matrix.os }}-nightly | |
- name: run the ad-dc deployment test | |
run: ./tests/test-samba-ad-server-kubernetes.sh | |
push: | |
# verify it passes the test jobs first | |
needs: | |
- build-client | |
- build-toolbox | |
- test-server | |
- test-nightly-server | |
- test-ad-server-kubernetes | |
- test-nightly-ad-server-kubernetes | |
runs-on: ubuntu-latest | |
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.repository == 'samba-in-kubernetes/samba-container' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: log in to quay.io | |
run: docker login -u "${{ secrets.QUAY_USER }}" -p "${{ secrets.QUAY_PASS }}" quay.io | |
- name: push server image | |
run: make push-server | |
- name: push ad-server image | |
run: make push-ad-server | |
- name: push client image | |
run: make push-client | |
- name: push toolbox image | |
run: make push-toolbox | |
- name: push nightly server image | |
run: make push-nightly-server | |
- name: push nightly ad server image | |
run: make push-nightly-ad-server |