Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add swift e2e #275

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@ jobs:
config: e2e/java.json
dry-run: true

- name: docker-builder (swift)
uses: ./
with:
command: docker-builder
config: e2e/swift.json
dry-run: true

- name: binary-builder (python)
uses: ./
with:
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ ARG HELM_VERSION=3.4.0
# renovate: datasource=adoptium-java depName=java
ARG JAVA_VERSION=8.0.302+8

# renovate: datasource=docker depName=swift versioning=loose
ARG SWIFT_VERSION=5.5.2

ARG DISTRO=latest
RUN echo DISTRO=$DISTRO
ENTRYPOINT ["echo" ]
5 changes: 5 additions & 0 deletions e2e/swift.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"image": "swift",
"startVersion": "5.3",
"extractVersion": "^(?<version>\\d+\\.\\d+(?:\\.\\d+)?)$"
}
4 changes: 4 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"extends": ["schedule:weekly"],
"automerge": true,
"separateMinorPatch": false
},
{
"matchPackageNames": ["swift"],
"extractVersion": "^(?<version>\\d+\\.\\d+(?:\\.\\d+)?)$"
}
]
}
8 changes: 8 additions & 0 deletions src/commands/docker/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,18 @@ async function getBuildList({
if (!pkgResult) {
return [];
}

log(`Found ${pkgResult.releases.length} raw versions`);

let allVersions = pkgResult.releases
.map((v) => v.version)
.filter((v) => ver.isVersion(v) && ver.isCompatible(v, startVersion));

log(
`Found ${allVersions.length} compatible versions:`,
allVersions.join(', ')
);

// filter duplicate versions (16.0.2+7 == 16.0.2+8)
allVersions = allVersions
.reverse()
Expand Down
6 changes: 6 additions & 0 deletions test/__snapshots__/util.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ ARG HELM_VERSION=3.4.0
# renovate: datasource=adoptium-java depName=java
ARG JAVA_VERSION=8.0.302+8

# renovate: datasource=docker depName=swift versioning=loose
ARG SWIFT_VERSION=5.5.2

ARG DISTRO=latest
RUN echo DISTRO=$DISTRO
ENTRYPOINT [\\"echo\\" ]
Expand All @@ -46,6 +49,9 @@ ARG HELM_VERSION=3.4.0
# renovate: datasource=adoptium-java depName=java
ARG JAVA_VERSION=8.0.302+8

# renovate: datasource=docker depName=swift versioning=loose
ARG SWIFT_VERSION=5.5.2

ARG DISTRO=latest
RUN echo DISTRO=$DISTRO
ENTRYPOINT [\\"echo\\" ]
Expand Down