Skip to content

Commit

Permalink
test: add tag option to smoke tests
Browse files Browse the repository at this point in the history
  • Loading branch information
khalilou88 committed Oct 15, 2024
1 parent 3e9227a commit 5e85ddc
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 9 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ name: Smoke tests
on:
# Trigger manually or on schedule
workflow_dispatch:
inputs:
tag_option:
type: choice
description: tag option
options:
- latest
- previous
- next
schedule:
- cron: '0 0 * * *'

Expand All @@ -18,6 +26,7 @@ jobs:
runs-on: ${{matrix.os}}
env:
NX_RUN_GROUP: ${{ github.run_id }}-v${{matrix.java}}
NPM_TAG: ${{ github.event.inputs.tag_option }}
steps:
- uses: actions/checkout@v4

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ describe('nx-gradle micronaut smoke', () => {

execSync('git init', execSyncOptions());

execSync('npm i --save-dev @jnxplus/nx-gradle', execSyncOptions());
execSync(
`npm i --save-dev @jnxplus/nx-gradle@${process.env.NPM_TAG}`,
execSyncOptions(),
);

execSync(
'npx nx generate @jnxplus/nx-gradle:init --preset micronaut',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ describe('nx-gradle default smoke', () => {

execSync('git init', execSyncOptions());

execSync('npm i --save-dev @jnxplus/nx-gradle', execSyncOptions());
execSync(
`npm i --save-dev @jnxplus/nx-gradle@${process.env.NPM_TAG}`,
execSyncOptions(),
);

execSync('npx nx generate @jnxplus/nx-gradle:init', execSyncOptions());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ describe('nx-gradle quarkus smoke', () => {

execSync('git init', execSyncOptions());

execSync('npm i --save-dev @jnxplus/nx-gradle', execSyncOptions());
execSync(
`npm i --save-dev @jnxplus/nx-gradle@${process.env.NPM_TAG}`,
execSyncOptions(),
);

execSync(
'npx nx generate @jnxplus/nx-gradle:init --gradleRootDirectory . --preset quarkus',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('nx-gradle spring-boot smoke', () => {

it('should work', async () => {
execSync(
'npx create-nx-gradle-workspace@latest test --javaVersion 17 --dsl kotlin --rootProjectName root-project --gradleRootDirectory nx-gradle --preset spring-boot',
`npx create-nx-gradle-workspace@${process.env.NPM_TAG} test --javaVersion 17 --dsl kotlin --rootProjectName root-project --gradleRootDirectory nx-gradle --preset spring-boot`,
{
cwd: smokeDirectory,
env: process.env,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ describe('nx-maven micronaut bom smoke', () => {

execSync('git init', execSyncOptions());

execSync('npm i --save-dev @jnxplus/nx-maven', execSyncOptions());
execSync(
`npm i --save-dev @jnxplus/nx-maven@${process.env.NPM_TAG}`,
execSyncOptions(),
);

execSync('npx nx generate @jnxplus/nx-maven:init', execSyncOptions());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('nx-maven micronaut smoke', () => {

it('should work', async () => {
execSync(
'npx create-nx-maven-workspace@latest test --javaVersion 17 --groupId com.example --parentProjectName root-project --parentProjectVersion 0.0.0 --mavenRootDirectory nx-maven --dependencyManagement micronaut-parent-pom',
`npx create-nx-maven-workspace@${process.env.NPM_TAG} test --javaVersion 17 --groupId com.example --parentProjectName root-project --parentProjectVersion 0.0.0 --mavenRootDirectory nx-maven --dependencyManagement micronaut-parent-pom`,
{
cwd: smokeDirectory,
env: process.env,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ describe('nx-maven quarkus smoke', () => {

execSync('git init', execSyncOptions());

execSync('npm i --save-dev @jnxplus/nx-maven', execSyncOptions());
execSync(
`npm i --save-dev @jnxplus/nx-maven@${process.env.NPM_TAG}`,
execSyncOptions(),
);

execSync('npx nx generate @jnxplus/nx-maven:init', execSyncOptions());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ describe('nx-maven spring-boot bom smoke', () => {

execSync('git init', execSyncOptions());

execSync('npm i --save-dev @jnxplus/nx-maven', execSyncOptions());
execSync(
`npm i --save-dev @jnxplus/nx-maven@${process.env.NPM_TAG}`,
execSyncOptions(),
);

execSync('npx nx generate @jnxplus/nx-maven:init', execSyncOptions());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ describe('nx-maven spring-boot smoke', () => {

execSync('git init', execSyncOptions());

execSync('npm i --save-dev @jnxplus/nx-maven', execSyncOptions());
execSync(
`npm i --save-dev @jnxplus/nx-maven@${process.env.NPM_TAG}`,
execSyncOptions(),
);

execSync(
'npx nx generate @jnxplus/nx-maven:init --mavenRootDirectory . --dependencyManagement spring-boot-parent-pom',
Expand Down

0 comments on commit 5e85ddc

Please sign in to comment.