diff --git a/.github/workflows/pkg-test.yml b/.github/workflows/pkg-test.yml new file mode 100644 index 00000000..48acbbd6 --- /dev/null +++ b/.github/workflows/pkg-test.yml @@ -0,0 +1,61 @@ +name: Test + +on: + # Trigger at every push. Action will also be visible from Pull Requests to master + push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions) + pull_request: + branches: [master] + +permissions: read-all + +jobs: + build: + name: Test + permissions: + contents: read + id-token: write + issues: write + pull-requests: write + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + java_version: [19] + runs-on: ${{ matrix.os }} + + steps: + # Git Checkout + - name: Checkout Code + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v3 + with: + role-to-assume: arn:aws:iam::712023778557:role/GitHub-Testing-NF-Quilt + aws-region: us-east-1 + + - name: Setup Java ${{matrix.java_version}} + uses: actions/setup-java@v3 + with: + java-version: ${{matrix.java_version}} + distribution: 'temurin' + architecture: x64 + cache: gradle + + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + + - name: Run Package Tests + run: make pkg-test + + - name: Archive production artifacts + if: ${{ success() }} || ${{ failure() }} + uses: actions/upload-artifact@v3 + with: + name: nf-quilt-pkg-test + path: | + /home/runner/work/nf-quilt/nf-quilt/plugins/nf-quilt/build/reports/tests/test/ diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy b/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy index 5b129d75..6a14192b 100644 --- a/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy +++ b/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy @@ -230,8 +230,9 @@ ${meta['workflow']['stats']['processes']} return template.toString() } - List match(String glob) throws IOException { - Path folder = pkg.install() + List match(String glob, boolean shouldInstall = false) throws IOException { + log.debug("QuiltProduct.match[$shouldInstall]: $glob") + Path folder = shouldInstall ? pkg.install() : pkg.packageDest() FileSystem fs = FileSystems.getDefault() PathMatcher pathMatcher = fs.getPathMatcher("glob:${glob}") List matches = [] diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy b/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy index d76ccb95..34e10406 100644 --- a/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy +++ b/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy @@ -137,9 +137,8 @@ class QuiltPackage { return namespace } - String resolveHash() { + String resolveHash(Namespace namespace) { if (hash == 'latest' || hash == null || hash == 'null') { - Namespace namespace = packageNamespace() return namespace.getHash('latest') } return hash @@ -147,7 +146,8 @@ class QuiltPackage { Manifest packageManifest() { Namespace namespace = packageNamespace() - Manifest manifest = namespace.getManifest(resolveHash()) + String newHash = resolveHash(namespace) + Manifest manifest = namespace.getManifest(newHash) return manifest } @@ -204,7 +204,6 @@ class QuiltPackage { try { log.info("installing $packageName from $bucket...") Manifest manifest = packageManifest() - manifest.install(dest) log.info('done') installed = true diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileSystemProvider.groovy b/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileSystemProvider.groovy index 8469307e..b7ae4c53 100644 --- a/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileSystemProvider.groovy +++ b/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileSystemProvider.groovy @@ -272,12 +272,13 @@ class QuiltFileSystemProvider extends FileSystemProvider { attributesCache = [:] // reset cache notifyFilePublish(qPath) } else { + // log.debug("\tEnsure installed: $installedPath") // ensure QuiltPackage installed - QuiltPackage pkg = qPath.pkg() - pkg.install() + qPath.pkg().install() + log.debug("\tReading from: $installedPath") } - //log.debug("\tOpening channel to: $installedPath") FileChannel channel = FileChannel.open(installedPath, options) + log.debug("FileChannel.open: ${channel}") return channel } catch (java.nio.file.NoSuchFileException e) {