Skip to content

Commit

Permalink
ci: test image before publish (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
AleF83 authored Dec 29, 2024
1 parent db0ce3e commit 58cc7b3
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 15 deletions.
30 changes: 29 additions & 1 deletion .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Build and push new version
on:
create:

env:
TILT_VERSION: 'v0.33.21'

jobs:
build_push_docker:
name: Build and Push Docker image
Expand Down Expand Up @@ -34,8 +37,33 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and export to Docker
uses: docker/build-push-action@v6
with:
load: true
tags: ${{ steps.get_version.outputs.version-without-v }}-test

- name: Setup Tilt
run: curl -fsSL https://raw.githubusercontent.com/tilt-dev/tilt/${TILT_VERSION}/scripts/install.sh | bash

- name: Setup pnpm
uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm

- name: Run npm install
run: pnpm install --frozen-lockfile

- name: Run Tests
run: pnpm run tilt:ci
env:
IMAGE_TAG: ${{ steps.get_version.outputs.version-without-v }}-test

- name: Build and push new docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
push: true
context: ./src
Expand Down
10 changes: 8 additions & 2 deletions Tiltfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
docker_compose('./e2e/docker-compose.yml')
dockerComps = ['./e2e/docker-compose.yml']

docker_build('oidc-server-mock', './src')
imageTag = os.getenv('IMAGE_TAG', '')
if imageTag == '':
docker_build('oidc-server-mock', './src')
else:
dockerComps.append( './e2e/docker-compose.override.yml')

docker_compose(dockerComps)

dc_resource('oidc-server-mock')
local_resource('tests', cmd='npm run test --workspace=e2e', resource_deps=['oidc-server-mock'])
3 changes: 3 additions & 0 deletions e2e/docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
services:
oidc-server-mock:
image: ghcr.io/soluto/oidc-server-mock:${IMAGE_TAG}-test
2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"chance": "^1.1.12",
"dotenv": "^16.4.7",
"jws": "^4.0.0",
"playwright-chromium": "^1.49.0",
"playwright-chromium": "^1.49.1",
"wait-on": "^8.0.1",
"yaml": "^2.6.1"
},
Expand Down
20 changes: 10 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/OpenIdConnectServerMock.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<IsPackable>true</IsPackable>
<Description>Configurable mock server with OpenId Connect functionality</Description>
<VersionPrefix>0.8.2</VersionPrefix>
<VersionPrefix>0.10.1</VersionPrefix>
<PackageProjectUrl>https://github.com/Soluto/oidc-server-mock</PackageProjectUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageTags>OIDC</PackageTags>
Expand Down

0 comments on commit 58cc7b3

Please sign in to comment.