Skip to content

Commit

Permalink
fix(test): windows stuffs
Browse files Browse the repository at this point in the history
  • Loading branch information
manuandru committed Mar 17, 2024
1 parent 05e52f1 commit 7aa85a5
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 54 deletions.
108 changes: 54 additions & 54 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ windows-2022, macos-12, ubuntu-22.04 ]
os: [ windows-2022 ]
runs-on: ${{ matrix.os }}
concurrency:
group: build-${{ github.workflow }}-${{ matrix.os }}-${{ github.event.number || github.ref }}
Expand Down Expand Up @@ -41,57 +41,57 @@ jobs:
maven-central-password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
signing-key: ${{ secrets.SIGNING_KEY }}
signing-password: ${{ secrets.SIGNING_PASSWORD }}
release:
permissions:
contents: write
packages: write
concurrency:
# Only one release job at a time. Strictly sequential.
group: release
needs:
- build
runs-on: ubuntu-22.04
if: >-
!github.event.repository.fork
&& github.event_name != 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
# release:
# permissions:
# contents: write
# packages: write
# concurrency:
# # Only one release job at a time. Strictly sequential.
# group: release
# needs:
# - build
# runs-on: ubuntu-22.04
# if: >-
# !github.event.repository.fork
# && github.event_name != 'pull_request'
# steps:
# - name: Checkout
# uses: actions/checkout@v4.1.1
## with:
## token: ${{ secrets.DEPLOYMENT_TOKEN }}
# - name: Find the version of Node from package.json
# id: node-version
# run: echo "version=$(jq -r .engines.node package.json)" >> $GITHUB_OUTPUT
# - name: Install Node
# uses: actions/setup-node@v4.0.2
# with:
# token: ${{ secrets.DEPLOYMENT_TOKEN }}
- name: Find the version of Node from package.json
id: node-version
run: echo "version=$(jq -r .engines.node package.json)" >> $GITHUB_OUTPUT
- name: Install Node
uses: actions/setup-node@v4.0.2
with:
node-version: ${{ steps.node-version.outputs.version }}
- uses: DanySK/build-check-deploy-gradle-action@2.4.8
with:
build-command: true
check-command: true
deploy-command: |
npm install
npx semantic-release
should-run-codecov: false
should-deploy: true
github-token: ${{ github.token }}
gradle-publish-secret: ${{ secrets.GRADLE_PUBLISH_SECRET }}
gradle-publish-key: ${{ secrets.GRADLE_PUBLISH_KEY }}
maven-central-username: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
maven-central-password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
signing-key: ${{ secrets.SIGNING_KEY }}
signing-password: ${{ secrets.SIGNING_PASSWORD }}
success:
runs-on: ubuntu-22.04
needs:
- release
- build
if: >-
always() && (
contains(join(needs.*.result, ','), 'failure')
|| !contains(join(needs.*.result, ','), 'cancelled')
)
steps:
- name: Verify that there were no failures
run: ${{ !contains(join(needs.*.result, ','), 'failure') }}
# node-version: ${{ steps.node-version.outputs.version }}
# - uses: DanySK/build-check-deploy-gradle-action@2.4.8
# with:
# build-command: true
# check-command: true
# deploy-command: |
# npm install
# npx semantic-release
# should-run-codecov: false
# should-deploy: true
# github-token: ${{ github.token }}
# gradle-publish-secret: ${{ secrets.GRADLE_PUBLISH_SECRET }}
# gradle-publish-key: ${{ secrets.GRADLE_PUBLISH_KEY }}
# maven-central-username: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
# maven-central-password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
# signing-key: ${{ secrets.SIGNING_KEY }}
# signing-password: ${{ secrets.SIGNING_PASSWORD }}
# success:
# runs-on: ubuntu-22.04
# needs:
# - release
# - build
# if: >-
# always() && (
# contains(join(needs.*.result, ','), 'failure')
# || !contains(join(needs.*.result, ','), 'cancelled')
# )
# steps:
# - name: Verify that there were no failures
# run: ${{ !contains(join(needs.*.result, ','), 'failure') }}
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ abstract class CheckNodeTask : DefaultTask() {
private fun downloadFromUrl(url: URL): Path {
val tempDir = createTempDirectory(TEMP_DIR_PREFIX).also { logger.quiet("Node will be downloaded in $it") }
val nodeArchive = tempDir.resolve(url.name())

println("AAAAaaaaaaaaaa $url")
println("AAAAaaaaaaaaaa ${url.name()}")
println("AAAAaaaaaaaaaa $nodeArchive")

runCatching {
url.openStream().use {
Files.copy(it, nodeArchive)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,12 @@ class TypescriptPluginTest : AnnotationSpec() {
.executeGradleTask("checkNode", "checkNode")
.output shouldContain "Node is installed at version v20.7.0" // version set in tested env
}

@Test
fun `wow`() {
val testFolder = getTempDirectoryWithResources("src/test/resources/download-node-env")

val out = testFolder.executeGradleTask("checkNode", "checkNode")
println(out.output)
}
}

0 comments on commit 7aa85a5

Please sign in to comment.