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

Update test strategy in github actions #186

Merged
merged 7 commits into from
Jan 27, 2024
Merged
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
18 changes: 10 additions & 8 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@ on: [push, pull_request]

jobs:
test:

runs-on: ubuntu-latest

strategy:
matrix:
java: [ '11', '17', '21' ]
nextflow: ['latest-edge', 'latest-stable' ]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install JDK 11
- name: Install JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: 11
java-version: ${{ matrix.java }}

- name: Install Nextflow v22.10.4
run: |
export NXF_VER=22.10.4;curl -s https://get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
- name: Setup Nextflow ${{ matrix.nextflow }}
uses: nf-core/setup-nextflow@v1
with:
version: "${{ matrix.nextflow }}"

- name: Test
run: mvn install
1 change: 1 addition & 0 deletions docs/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
www.nf-test.com
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.askimed</groupId>
<artifactId>nf-test</artifactId>
<version>0.8.2</version>
<version>0.8.3</version>
<name>nf-test</name>
<description>Simple test framework for Nextflow pipelines</description>
<url>https://github.com/askimed/nf-test</url>
Expand Down Expand Up @@ -37,20 +37,20 @@
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>3.0.9</version>
<version>3.0.19</version>
<type>pom</type>
</dependency>

<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-nio</artifactId>
<version>3.0.9</version>
<version>3.0.19</version>
</dependency>

<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-yaml</artifactId>
<version>3.0.9</version>
<version>3.0.19</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/askimed/nf/test/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class App {

public static final String NAME = "nf-test";

public static final String VERSION = "0.8.2";
public static final String VERSION = "0.8.3";

public static final String PACKAGE = "com.askimed.nf.test";

Expand Down
14 changes: 14 additions & 0 deletions src/main/java/com/askimed/nf/test/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public class Config {

private StageBuilder stageBuilder = new StageBuilder();

private String stageMode = FileStaging.MODE_COPY;

public void testsDir(String testsDir) {
this.testsDir = testsDir;
}
Expand Down Expand Up @@ -114,6 +116,18 @@ public String getLibDir() {
return libDir;
}

public void setStageMode(String stageMode) {
this.stageMode = stageMode;
}

public String getStageMode() {
return stageMode;
}

public void stageMode(String stageMode) {
this.stageMode = stageMode;
}

public void stage(Closure closure) {
closure.setDelegate(stageBuilder);
closure.setResolveStrategy(Closure.DELEGATE_ONLY);
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/com/askimed/nf/test/core/AbstractTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ public abstract class AbstractTest implements ITest {

public boolean skipped = false;

public static FileStaging[] SHARED_DIRECTORIES = { new FileStaging("bin"), new FileStaging("lib"),
new FileStaging("assets") };

protected File config = null;

private boolean updateSnapshot = false;
Expand Down Expand Up @@ -109,10 +106,14 @@ public void setup(Config config, File testDirectory) throws IOException {
metaDir = initDirectory("Meta Directory", launchDir, DIRECTORY_META);
outputDir = initDirectory("Output Directory", launchDir, DIRECTORY_OUTPUT);
workDir = initDirectory("Working Directory", launchDir, DIRECTORY_WORK);

FileStaging[] sharedDirectories = new FileStaging[]{
new FileStaging("bin", config != null ? config.getStageMode() : FileStaging.MODE_COPY),
new FileStaging("lib", config != null ? config.getStageMode() : FileStaging.MODE_COPY),
new FileStaging("assets", config != null ? config.getStageMode() : FileStaging.MODE_COPY)
};
try {
// copy bin, assets and lib to metaDir
shareDirectories(SHARED_DIRECTORIES, metaDir);
shareDirectories(sharedDirectories, metaDir);
if (config != null) {
// copy user defined staging directories
log.debug("Stage {} user provided files...", config.getStageBuilder().getPaths().size());
Expand Down
Loading