Skip to content

ci: test docker builds for PRs and pushes on master#114

Merged
DonKirkham merged 3 commits into
pnp:masterfrom
CalvinTPark:ci/test-builds
May 18, 2026
Merged

ci: test docker builds for PRs and pushes on master#114
DonKirkham merged 3 commits into
pnp:masterfrom
CalvinTPark:ci/test-builds

Conversation

@CalvinTPark
Copy link
Copy Markdown
Contributor

@CalvinTPark CalvinTPark commented Jan 10, 2026

Related Issue

fix #116

Details

Adds GitHub CI workflow to test docker image builds.

Helps ensure repo changes build and are tested against a sample SPFx project:

  • Builds docker image on:
    • linux/amd64
    • linux/arm64/v8
  • Creates and builds a sample SPFx react webpart

See example runs:

GitHub Docker Report example (build) [Click to open]

Docker Build summary

For a detailed look at the build, download the following build record archive and import it into Docker Desktop's Builds view.
Build records include details such as timing, dependencies, results, logs, traces, and other information about a build. Learn more

⬇️ CalvinTPark~docker-spfx~N682B3.dockerbuild (36.43 KB - includes 1 build record)

Find this useful? Let us know

IDNameStatusCachedDuration
N682B3docker-spfx (default)✅ completed50%2s

Build inputs
workdir: .
set:
  - '*.cache-from=type=gha,scope=dockerspfx'
  - '*.cache-to=type=gha,scope=dockerspfx,mode=max'
targets:
  - default
Bake definition
{
  "group": {
    "default": {
      "targets": [
        "default"
      ]
    }
  },
  "target": {
    "default": {
      "context": ".",
      "dockerfile": "Dockerfile",
      "tags": [
        "docker.io/m365pnp/spfx:latest",
        "docker.io/m365pnp/spfx:online"
      ],
      "cache-from": [
        {
          "scope": "dockerspfx",
          "type": "gha"
        }
      ],
      "cache-to": [
        {
          "mode": "max",
          "scope": "dockerspfx",
          "type": "gha"
        }
      ],
      "target": "default",
      "platforms": [
        "linux/amd64",
        "linux/arm64/v8"
      ]
    }
  }
}

GitHub Docker Report example (test) [Click to open]

Docker Build summary

For a detailed look at the build, download the following build record archive and import it into Docker Desktop's Builds view.
Build records include details such as timing, dependencies, results, logs, traces, and other information about a build. Learn more

⬇️ CalvinTPark~docker-spfx~0RMDXK.dockerbuild (74.39 KB - includes 1 build record)

Find this useful? Let us know

IDNameStatusCachedDuration
0RMDXKdocker-spfx✅ completed27%6m21s

Build inputs
workdir: .
set:
  - '*.cache-from=type=gha,scope=dockerspfx'
  - '*.cache-to=type=gha,scope=dockerspfx,mode=max'
targets:
  - test
Bake definition
{
  "group": {
    "default": {
      "targets": [
        "test"
      ]
    }
  },
  "target": {
    "test": {
      "context": ".",
      "dockerfile": "Dockerfile",
      "cache-from": [
        {
          "scope": "dockerspfx",
          "type": "gha"
        }
      ],
      "cache-to": [
        {
          "mode": "max",
          "scope": "dockerspfx",
          "type": "gha"
        }
      ],
      "platforms": [
        "linux/amd64",
        "linux/arm64/v8"
      ],
      "output": [
        {
          "type": "cacheonly"
        }
      ]
    }
  }
}

Potential task: fix the PNPM cache across test runs

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds continuous integration testing for Docker image builds on PRs and pushes to the master branch. The workflow validates that the Docker image can be successfully built on both linux/amd64 and linux/arm64/v8 platforms and can create and build a sample SPFx React webpart project.

Changes:

  • Adds new CI workflow that builds the Docker image and tests it by creating a sample SPFx webpart
  • Converts Dockerfile to multi-stage build with test stages for automated validation
  • Adds docker-bake.hcl configuration for managing build targets and platforms

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
.github/workflows/ci.yml New CI workflow that builds and tests the Docker image on PRs and master branch pushes
docker-bake.hcl New Docker Bake configuration defining build targets for default image and test scenarios
Dockerfile Refactored to multi-stage build with test stages (test-base, test-webpart) for CI validation
.github/workflows/build-and-push.yaml Updated to specify the 'default' build target for consistency with new multi-stage structure
.gitattributes Enforces LF line endings for consistent cross-platform behavior
.dockerignore Excludes unnecessary files from Docker build context (.github, assets, OS-specific files)
README.md Adds documentation section with examples for building and running custom images

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml
Comment thread Dockerfile
Comment thread Dockerfile
Comment thread docker-bake.hcl
Comment thread .github/workflows/ci.yml
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ci.yml workflow uses actions/checkout@v6 while the existing build-and-push.yaml workflow uses actions/checkout@v4. These should use the same version for consistency across the repository's CI workflows.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
@DonKirkham DonKirkham merged commit 814fa32 into pnp:master May 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a GitHub Actions workflow to automate testing

3 participants