Skip to content

Commit

Permalink
dont run smoke publish on mac ci
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed May 9, 2024
1 parent f15d852 commit c1022d0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 26 deletions.
19 changes: 1 addition & 18 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,29 +162,12 @@ jobs:
- name: Linux
os: ubuntu-latest
shell: bash
- name: macOS
os: macos-latest
shell: bash
- name: macOS
os: macos-13
shell: bash
node-version:
- 18.17.0
- 18.x
- 20.5.0
- 20.x
- 22.x
exclude:
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 18.17.0
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 18.x
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 20.5.0
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 20.x
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 22.x
runs-on: ${{ matrix.platform.os }}
defaults:
run:
Expand Down Expand Up @@ -221,7 +204,7 @@ jobs:
run: ./scripts/smoke-publish-test.sh
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.6.0
if: always()
if: steps.create-check.outputs.check-id && always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ${{ job.status }}
Expand Down
4 changes: 2 additions & 2 deletions scripts/smoke-publish-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ node . install -w smoke-tests --ignore-scripts --no-audit --no-fund
# debugging locally when we want to pass args to the smoke-tests to limit the
# files being run or grep a test, etc. Also now set CI=true so we get more
# debug output in our tap tests
CI="true" SMOKE_PUBLISH_NPM="1" SMOKE_PUBLISH_TARBALL="$NPM_TARBALL" npm test \
CI="true" SMOKE_PUBLISH_TARBALL="$NPM_TARBALL" npm test \
-w smoke-tests \
--ignore-scripts \
-- -Rtap "$@"
-- "$@"
3 changes: 2 additions & 1 deletion scripts/template-oss/ci-release-yml.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
jobCheckout=(obj ref="${{ inputs.ref }}")
jobCreateCheck=(obj sha="${{ inputs.check-sha }}")
windowsCI=false
macCI=false
}}
- name: Smoke Publish
run: ./scripts/smoke-publish-test.sh
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.6.0
if: always()
if: steps.create-check.outputs.check-id && always()
with:
token: $\{{ secrets.GITHUB_TOKEN }}
conclusion: $\{{ job.status }}
Expand Down
10 changes: 5 additions & 5 deletions smoke-tests/test/fixtures/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const MockRegistry = require('@npmcli/mock-registry')
const http = require('http')
const { createProxy } = require('proxy')

const { SMOKE_PUBLISH_NPM, SMOKE_PUBLISH_TARBALL, CI, PATH, Path } = process.env
const { SMOKE_PUBLISH_TARBALL, CI, PATH, Path } = process.env

const DEFAULT_REGISTRY = new URL('https://registry.npmjs.org/')
const MOCK_REGISTRY = new URL('http://smoke-test-registry.club/')
Expand Down Expand Up @@ -75,7 +75,7 @@ const getCleanPaths = async () => {

module.exports = async (t, { testdir = {}, debug, mockRegistry = true, useProxy = false } = {}) => {
const debugLog = debug || CI ? (...a) => t.comment(...a) : () => {}
debugLog({ SMOKE_PUBLISH_NPM, SMOKE_PUBLISH_TARBALL, CI })
debugLog({ SMOKE_PUBLISH_TARBALL, CI })

const cleanPaths = await getCleanPaths()

Expand Down Expand Up @@ -219,7 +219,7 @@ module.exports = async (t, { testdir = {}, debug, mockRegistry = true, useProxy

const npmLocal = async (...args) => {
const [{ force = false }] = getOpts(...args)
if (SMOKE_PUBLISH_NPM && !force) {
if (SMOKE_PUBLISH_TARBALL && !force) {
throw new Error('npmLocal cannot be called during smoke-publish')
}
return baseNpm({
Expand Down Expand Up @@ -251,7 +251,7 @@ module.exports = async (t, { testdir = {}, debug, mockRegistry = true, useProxy
return {
npmPath,
npmLocal,
npm: SMOKE_PUBLISH_NPM ? npmPath : npm,
npm: SMOKE_PUBLISH_TARBALL ? npmPath : npm,
spawn: baseSpawn,
readFile,
getPath,
Expand All @@ -269,6 +269,6 @@ module.exports.testdir = testdirHelper
module.exports.getNpmRoot = getNpmRoot
module.exports.CLI_ROOT = CLI_ROOT
module.exports.WINDOWS = WINDOWS
module.exports.SMOKE_PUBLISH = !!SMOKE_PUBLISH_NPM
module.exports.SMOKE_PUBLISH = !!SMOKE_PUBLISH_TARBALL
module.exports.SMOKE_PUBLISH_TARBALL = SMOKE_PUBLISH_TARBALL
module.exports.MOCK_REGISTRY = MOCK_REGISTRY

0 comments on commit c1022d0

Please sign in to comment.