Skip to content

Commit

Permalink
fix: upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
test123456789012345 committed Jun 15, 2020
1 parent 8430541 commit 502a46f
Show file tree
Hide file tree
Showing 7 changed files with 2,592 additions and 8,452 deletions.
32 changes: 23 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,49 @@
name: build

on:
push:
branches:
- '**'

- "**"
jobs:
cancel-existing:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@v0.2.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test:
runs-on: ${{ matrix.os }}
needs: cancel-existing
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
node: [10, 12]
os:
- macos-latest
- windows-latest
- ubuntu-latest
node:
- 10
- 12
exclude:
- os: macos-latest
node: 10
- os: windows-latest
node: 10
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: git config --global user.email "actions@github.com"
- run: git config --global user.name "GitHub Actions"
- run: yarn --frozen-lockfile
- run: yarn test
- name: Coveralls
if: matrix.os == 'ubuntu-latest' && matrix.node == 12
run: yarn dw-ci coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
COVERALLS_GIT_COMMIT: ${{ github.sha }}
COVERALLS_GIT_BRANCH: ${{ github.ref }}

release:
needs: test
if: github.ref == 'refs/heads/master'
Expand All @@ -41,7 +53,10 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 12
- run: git config --global user.email "actions@github.com"
- run: git config --global user.name "GitHub Actions"
- run: yarn --frozen-lockfile
- run: yarn lint
- name: Push changed files
run: yarn dw-ci push-changed-files
env:
Expand All @@ -51,5 +66,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
yarn semantic-release
run: yarn semantic-release
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
.DS_Store
/.babelrc.json
/.cz.json
/.editorconfig
/.env
/.env.json
/.eslintrc.json
/.nyc_output
/.releaserc.json
/.test.env.json
/.vscode
/coverage
/dist
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<!-- BADGES/ -->
[![NPM version](https://img.shields.io/npm/v/is-gitpod.svg)](https://npmjs.org/package/is-gitpod)
![Linux macOS Windows compatible](https://img.shields.io/badge/os-linux%20%7C%C2%A0macos%20%7C%C2%A0windows-blue)

[![Build status](https://img.shields.io/github/workflow/status/dword-design/is-gitpod/build)](https://github.com/dword-design/is-gitpod/actions)
[![Coverage status](https://img.shields.io/coveralls/dword-design/is-gitpod)](https://coveralls.io/github/dword-design/is-gitpod)
[![Dependency status](https://img.shields.io/david/dword-design/is-gitpod)](https://david-dm.org/dword-design/is-gitpod)
Expand All @@ -19,7 +18,7 @@ Checks if we are in Gitpod
<!-- /DESCRIPTION -->

<!-- INSTALL/ -->
# Install
## Install

```bash
# NPM
Expand Down Expand Up @@ -47,7 +46,7 @@ const result = await isGitpod()
```

<!-- LICENSE/ -->
# License
## License

Unless stated otherwise all works are:

Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
],
"scripts": {
"commit": "base commit",
"depgraph": "base depgraph",
"dev": "base dev",
"lint": "base lint",
"prepare": "base prepare",
"prepublishOnly": "base prepublishOnly",
"release": "base release",
"test": "base test"
},
"dependencies": {
Expand All @@ -29,5 +29,8 @@
"execa": "^4.0.0",
"fs-extra": "^9.0.0",
"with-local-tmp-dir": "^2.2.3"
},
"publishConfig": {
"access": "public"
}
}
5 changes: 3 additions & 2 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

import api from '.'

(async () => {
const run = async () => {
if (!(await api())) {
process.exit(1)
}
})()
}
run()
40 changes: 20 additions & 20 deletions src/cli.spec.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
import { filter, join, split } from '@dword-design/functions'
import execa from 'execa'
import { chmod, outputFile } from 'fs-extra'
import withLocalTmpDir from 'with-local-tmp-dir'
import { outputFile, chmod } from 'fs-extra'
import { split, filter, join } from '@dword-design/functions'

const pathDelimiter = process.platform === 'win32' ? ';' : ':'

const getModifiedPath = () => [
...process.env.PATH
|> split(pathDelimiter)
|> filter(path => !['/bin', '/usr/bin'].includes(path)),
process.cwd(),
]
|> join(pathDelimiter)
const getModifiedPath = () =>
[
...(process.env.PATH
|> split(pathDelimiter)
|> filter(path => !['/bin', '/usr/bin'].includes(path))),
process.cwd(),
] |> join(pathDelimiter)

export default {
'inside gitpod': () => withLocalTmpDir(async () => {
const filename = `gp${process.platform === 'win32' ? '.bat' : ''}`
await outputFile(filename, '')
await chmod(filename, '755')
const { all } = await execa(require.resolve('./cli'), {
env: { ...process.env, PATH: getModifiedPath() },
all: true,
})
expect(all).toEqual('')
}),
'inside gitpod': () =>
withLocalTmpDir(async () => {
const filename = `gp${process.platform === 'win32' ? '.bat' : ''}`
await outputFile(filename, '')
await chmod(filename, '755')
const output = await execa(require.resolve('./cli'), {
env: { ...process.env, PATH: getModifiedPath() },
all: true,
})
expect(output.all).toEqual('')
}),
'outside gitpod': async () => {
let all
try {
Expand Down
Loading

0 comments on commit 502a46f

Please sign in to comment.