Skip to content

Commit

Permalink
wip(ci): test
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Feb 7, 2024
1 parent 750260f commit dbee7a7
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 65 deletions.
133 changes: 69 additions & 64 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ on:

jobs:

create_pre_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: GH_CREATE_PRE_RELEASE=true ./script/ci/release.sh
if: github.ref == 'refs/heads/master' && env.ACT != 'true' && runner.os == 'Linux'
env:
# create_pre_release:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - run: GH_CREATE_PRE_RELEASE=true ./script/ci/release.sh
# if: github.ref == 'refs/heads/master' && env.ACT != 'true' && runner.os == 'Linux'
# env:
GITHUB_TOKEN: ${{ github.token }}

prebuild:
needs: [ create_pre_release ]
# needs: [ create_pre_release ]
runs-on: ${{ matrix.os }}
defaults:
run:
Expand All @@ -29,7 +29,12 @@ jobs:
fail-fast: false
matrix:
node-version: [20]
os: [macos-14,macos-12,ubuntu-latest,windows-latest]
os: [
# macos-14,
# macos-12,
ubuntu-latest,
# windows-latest
]

env:
NODE_VERSION: ${{ matrix.node-version }}
Expand Down Expand Up @@ -76,37 +81,37 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}

test:
runs-on: ${{ matrix.os }}
needs: [prebuild]
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
node-version: [16,18,20]
os: [macos-14, macos-12, ubuntu-latest,windows-latest]
# test:
# runs-on: ${{ matrix.os }}
# needs: [prebuild]
# defaults:
# run:
# shell: bash
# strategy:
# fail-fast: false
# matrix:
# node-version: [16,18,20]
# os: [macos-14, macos-12, ubuntu-latest,windows-latest]

env:
NODE_VERSION: ${{ matrix.node-version }}
# env:
# NODE_VERSION: ${{ matrix.node-version }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0

- name: Download prebuilds
uses: actions/download-artifact@v3
# - name: Download prebuilds
# uses: actions/download-artifact@v3

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
# - name: Use Node.js ${{ env.NODE_VERSION }}
# uses: actions/setup-node@v4
# with:
# node-version: ${{ env.NODE_VERSION }}

- if: runner.os == 'Windows'
run: echo "ONLY_DOWNLOAD_PACT_FOR_WINDOWS=true" >> $GITHUB_ENV
- run: ./script/ci/unpack-and-test.sh
# - if: runner.os == 'Windows'
# run: echo "ONLY_DOWNLOAD_PACT_FOR_WINDOWS=true" >> $GITHUB_ENV
# - run: ./script/ci/unpack-and-test.sh


# Linux aarch64 tests are skipped as QEMU fails when executing the ruby binaries
Expand All @@ -121,30 +126,30 @@ jobs:
# name: test arm64
# run: docker run -v $PWD:/home --platform linux/arm64 --rm node:20 bin/bash -c 'cd /home && /home/script/ci/unpack-and-test.sh'

release_dry_run:
runs-on: ubuntu-latest
needs: [ create_pre_release, prebuild ]
if: github.ref == 'refs/heads/master'

env:
NODE_VERSION: 20

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'

- name: "release - dry run: ${{ env.DRY_RUN }}"
id: publish
run: script/ci/release.sh
env:
GITHUB_TOKEN: ${{ github.token }}
DRY_RUN: true

- run: echo "New Release will be v${{ steps.publish.outputs.version }}"
# release_dry_run:
# runs-on: ubuntu-latest
# needs: [ create_pre_release, prebuild ]
# if: github.ref == 'refs/heads/master'

# env:
# NODE_VERSION: 20

# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0

# - name: Use Node.js ${{ env.NODE_VERSION }}
# uses: actions/setup-node@v4
# with:
# node-version: ${{ env.NODE_VERSION }}
# registry-url: 'https://registry.npmjs.org'

# - name: "release - dry run: ${{ env.DRY_RUN }}"
# id: publish
# run: script/ci/release.sh
# env:
# GITHUB_TOKEN: ${{ github.token }}
# DRY_RUN: true

# - run: echo "New Release will be v${{ steps.publish.outputs.version }}"
2 changes: 1 addition & 1 deletion script/ci/prebuild-alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd)" # Figure out where the
node --version
npm --version
PREBUILDIFY_VERSION=5.0.1
apk add bash curl python3 make g++

. "${SCRIPT_DIR}/../lib/export-binary-versions.sh"
"${SCRIPT_DIR}/../lib/download-ffi.sh"
rm -rf build node_modules
apk add bash curl python3 make g++
npm ci --ignore-scripts
npx --yes prebuildify@${PREBUILDIFY_VERSION} --napi --libc musl --tag-libc
ls prebuilds/**/*
Expand Down

0 comments on commit dbee7a7

Please sign in to comment.