How do I actually use my new code as a package for another one of my projects?

I wrote a little code here:

https://github.com/CTMacUser/EmbeddedIntegerCollection
  1. I experimented adding a GitHub Action, for CD/CI, and it reports an error. It seems that the (default) action for SPM tests doesn't support package files marked as Swift 6.0. I don't know how to fix this, and don't know whether the fix is to upgrade the default test running script, or to lower the package file to something in 5.x. (The package uses the new Swift Testing system.)
  2. Despite this, I tried adding the URL for the first project to the package file for my second project.
    dependencies: [
        .package(
            url: "https://github.com/CTMacUser/EmbeddedIntegerCollection.git",
            from: "0.1.0"),
    ],

I get a warning of:

dependency 'embeddedintegercollection' is not used by any target

And in the new type's file, adding a line of "import EmbeddedIntegerCollection" gives me an error of "No such module 'EmbeddedIntegerCollection'", with a fix-it of searching for package collections.

What am I missing?

Point 2 - you need to add it as a dependency of your target as well.

See example here.

You also need to define dependencies for your targets in your Package.swift.

Something like the following should work:

.target(
        name: "<the target's name>",
        dependencies: [
            "EmbeddedIntegerCollection"
            // or
            .product(name: "EmbeddedIntegerCollection", package: "EmbeddedIntegerCollection")
        ]
)

The Swift Package Manager documentation and Apple's documentation about swift packages might also help you.

Regarding the failed GitHub action, it looks like you need to specify the Swift toolchain you want to build for. I don't usually use that kind of thing, but adding a strategy with specified swift_versions to your build job in your swift.yml would probably make it work.

Maybe something like

strategy:
      fail-fast: false
      matrix:
        swift_version: ['5.9', '6.0']