-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: replace Travis CI/AppVeyor with GitHub Actions, prebuild for macO…
…S/arm64 (#126) * ci: replace Travis CI/AppVeyor with GitHub Actions * chore: remove use of prebuildify-ci * Note that the step only dry runs publishing
- Loading branch information
Showing
4 changed files
with
130 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v[0-9]+.[0-9]+.[0-9]+* | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-latest, macOS-latest, ubuntu-latest] | ||
node-version: [12.x, 14.x, 16.x] | ||
|
||
steps: | ||
- name: Fix git checkout line endings | ||
run: git config --global core.autocrlf input | ||
- uses: actions/checkout@v2.3.4 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v2.3.0 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Get yarn cache | ||
id: yarn-cache | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
- uses: actions/cache@v2.1.6 | ||
with: | ||
path: ${{ steps.yarn-cache.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Windows Setup | ||
if: matrix.os == 'windows-latest' | ||
run: yarn prepare-win32 | ||
- name: Install | ||
run: yarn | ||
- name: Lint | ||
run: yarn jshint | ||
- name: Test | ||
run: yarn test | ||
|
||
prebuild: | ||
needs: test | ||
runs-on: ${{ matrix.os }}-latest | ||
strategy: | ||
matrix: | ||
os: [windows, macOS, ubuntu] | ||
arch: [x64, arm64] | ||
exclude: | ||
- os: windows | ||
arch: arm64 | ||
include: | ||
- os: windows | ||
arch: ia32 | ||
|
||
steps: | ||
- name: Fix git checkout line endings | ||
run: git config --global core.autocrlf input | ||
- uses: actions/checkout@v2.3.4 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v2.3.0 | ||
with: | ||
node-version: 12.x | ||
- name: Get yarn cache | ||
id: yarn-cache | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
- uses: actions/cache@v2.1.6 | ||
with: | ||
path: ${{ steps.yarn-cache.outputs.dir }} | ||
key: ${{ runner.os }}-${{ matrix.arch }}-yarn-${{ hashFiles('**/package.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.arch }}-yarn- | ||
- name: Windows Setup | ||
if: matrix.os == 'windows' | ||
run: yarn prepare-win32 | ||
- name: Install | ||
run: yarn | ||
- name: Prebuild binaries | ||
run: yarn prebuild --v8_enable_pointer_compression=false --v8_enable_31bit_smis_on_64bit_arch=false | ||
env: | ||
PREBUILD_ARCH: ${{ matrix.arch }} | ||
- name: Upload binaries as an artifact | ||
uses: actions/upload-artifact@v2.3.1 | ||
with: | ||
name: prebuild-${{ matrix.os }}-${{ matrix.arch }} | ||
path: prebuilds | ||
|
||
publish: | ||
needs: prebuild | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Fix git checkout line endings | ||
run: git config --global core.autocrlf input | ||
- uses: actions/checkout@v2.3.4 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v2.3.0 | ||
with: | ||
node-version: 12.x | ||
- name: Get yarn cache | ||
id: yarn-cache | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
- uses: actions/cache@v2.1.6 | ||
with: | ||
path: ${{ steps.yarn-cache.outputs.dir }} | ||
key: ${{ runner.os }}-${{ matrix.arch }}-yarn-${{ hashFiles('**/package.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.arch }}-yarn- | ||
- name: Install | ||
run: yarn | ||
- name: Download prebuild artifacts | ||
uses: actions/download-artifact@v2.1.0 | ||
with: | ||
path: artifacts | ||
- name: Merge artifacts to prebuilds directory | ||
run: | | ||
mkdir prebuilds | ||
mv artifacts/*/* prebuilds/ | ||
rm -r artifacts | ||
ls prebuilds | ||
- name: Publish to NPM (dry run) | ||
run: npm publish --dry-run |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters