-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: upgrade compilation, deps, ci config.
- Loading branch information
1 parent
0e4dd77
commit 2abc48e
Showing
11 changed files
with
222 additions
and
101 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,88 @@ | ||
name: run ci for fibjs | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'ci/**' | ||
- 'ci-**' | ||
- 'releases/**' | ||
- 'feat/**' | ||
- 'bugfix/**' | ||
- 'dev' | ||
- 'master' | ||
- 'test_ci' | ||
tags: | ||
- v*.*.* | ||
- test_github_actions_* | ||
pull_request: | ||
branches: | ||
- 'dev' | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
continue-on-error: true | ||
strategy: | ||
matrix: | ||
os: [ubuntu-18.04, windows-2019, macos-10.15] | ||
version: [0.21.0, 0.22.0, 0.23.0, 0.24.0, 0.25.0, 0.26.0, 0.26.1] | ||
arch: [amd64, i386] | ||
exclude: | ||
- os: windows-2019 | ||
arch: i386 | ||
- os: macos-10.15 | ||
arch: i386 | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Set Env Variables | ||
id: set-env-vars | ||
shell: bash | ||
run: | | ||
bash .github/workflows/set-env-vars.sh | ||
env: | ||
ARCH: ${{ matrix.arch }} | ||
OS: ${{ matrix.os }} | ||
|
||
- name: Install FIBJS | ||
shell: bash | ||
run: | | ||
mkdir -p ./node_modules/.bin; | ||
rm -rf ./node_modules/.bin/fibjs; | ||
if [[ "$RUNNER_OS" == "Linux" ]]; then | ||
curl -SL "https://github.com/fibjs/fibjs/releases/download/v${FIBJS_VERSION}/fibjs-v${FIBJS_VERSION}-${FIBJS_OS}-${FIBJS_ARCH}.xz" -o ./node_modules/.bin/fibjs.xz; | ||
xz -d ./node_modules/.bin/fibjs.xz; | ||
chmod a+x ./node_modules/.bin/fibjs; | ||
elif [[ "$RUNNER_OS" == "macOS" ]]; then | ||
curl -SL "https://github.com/fibjs/fibjs/releases/download/v${FIBJS_VERSION}/fibjs-v${FIBJS_VERSION}-${FIBJS_OS}-${FIBJS_ARCH}" -o ./node_modules/.bin/fibjs; | ||
chmod a+x ./node_modules/.bin/fibjs; | ||
else | ||
curl -SL "https://github.com/fibjs/fibjs/releases/download/v${FIBJS_VERSION}/fibjs-v${FIBJS_VERSION}-${FIBJS_OS}-${FIBJS_ARCH}.exe" -o ./node_modules/.bin/fibjs.exe; | ||
fi | ||
env: | ||
FIBJS_OS: ${{ steps.set-env-vars.outputs.FIBJS_OS }} | ||
FIBJS_ARCH: ${{ steps.set-env-vars.outputs.FIBJS_ARCH }} | ||
FIBJS_VERSION: ${{ matrix.version }} | ||
|
||
- name: Run CI | ||
shell: bash | ||
run: | | ||
if [[ -f ".github/workflows/run-ci.sh" ]]; then | ||
bash .github/workflows/run-ci.sh; | ||
else | ||
npm install; | ||
npm run ci; | ||
fi | ||
env: | ||
FIBJS_OS: ${{ steps.set-env-vars.outputs.FIBJS_OS }} | ||
GIT_BRANCH: ${{ steps.set-env-vars.outputs.GIT_BRANCH }} | ||
RELEASE_TAG: ${{ steps.set-env-vars.outputs.RELEASE_TAG }} | ||
GIT_TAG: ${{ steps.set-env-vars.outputs.GIT_TAG }} |
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,56 @@ | ||
export GIT_BRANCH=${GITHUB_REF#refs/heads/} | ||
echo "::set-output name=GIT_BRANCH::$GIT_BRANCH" | ||
export GIT_TAG=$(git tag | grep $(git describe --tags HEAD)) | ||
echo "::set-output name=GIT_TAG::$GIT_TAG" | ||
export GIT_COMMIT_HEAD_MSG=$(git log --format=%b -1) | ||
echo "::set-output name=GIT_COMMIT_HEAD_MSG::$GIT_COMMIT_HEAD_MSG" | ||
export GIT_COMMIT_SHORTCUTS=$(git log --format=%h -1) | ||
echo "::set-output name=GIT_COMMIT_SHORTCUTS::$GIT_COMMIT_SHORTCUTS" | ||
export GIT_COMMIT_TIME=$(git show -s --format="%cd" --date=format:%Y%m%d%H%M%S HEAD) | ||
echo "::set-output name=GIT_COMMIT_TIME::$GIT_COMMIT_TIME" | ||
|
||
if [[ "$GIT_TAG" =~ ^v?[012]\.[0-9]+\.[0-9]+$ ]]; then | ||
export IS_GIT_TAG_MATCH_SEMVER="true" | ||
echo "::set-output name=IS_GIT_TAG_MATCH_SEMVER::$IS_GIT_TAG_MATCH_SEMVER" | ||
fi | ||
|
||
if [ -z "$GIT_TAG" ]; then | ||
export RELEASE_TAG="$GIT_COMMIT_TIME-$GIT_COMMIT_SHORTCUTS"; | ||
else | ||
export RELEASE_TAG="$GIT_TAG"; | ||
fi | ||
if [ -z "$IS_GIT_TAG_MATCH_SEMVER" ]; then | ||
SUFFIX=${GIT_BRANCH//\//'-'} | ||
RELEASE_TAG="$RELEASE_TAG-$SUFFIX" | ||
fi | ||
echo "::set-output name=RELEASE_TAG::$RELEASE_TAG"; | ||
|
||
case "${RUNNER_OS}" in | ||
Windows) | ||
export FIBJS_OS=windows | ||
;; | ||
macOS) | ||
export FIBJS_OS=darwin | ||
;; | ||
Linux) | ||
export FIBJS_OS=linux | ||
;; | ||
*) | ||
echo "unsupported RUNNER_OS ${RUNNER_OS}"; | ||
exit 1 | ||
;; | ||
esac | ||
echo "::set-output name=FIBJS_OS::$FIBJS_OS"; | ||
|
||
case "${ARCH}" in | ||
i386) | ||
export FIBJS_ARCH=x86 | ||
;; | ||
amd64) | ||
export FIBJS_ARCH=x64 | ||
;; | ||
*) | ||
export FIBJS_ARCH=$ARCH | ||
;; | ||
esac | ||
echo "::set-output name=FIBJS_ARCH::$FIBJS_ARCH"; |
This file was deleted.
Oops, something went wrong.
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
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
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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
import builtInModules from './builtin-modules' | ||
/// <reference types="@fibjs/types" /> | ||
|
||
export = builtInModules | ||
import './util/get-builtin-module-hash'; | ||
import './util/is-builtin-module'; | ||
|
||
import builtInModules = require('./builtin-modules') | ||
|
||
export = builtInModules; | ||
|
||
// export * from './util/get-builtin-module-hash'; | ||
// export * from './util/is-builtin-module'; |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
const builtInModules = require('../../') | ||
import builtInModules from '../builtin-modules' | ||
|
||
export = function getBuiltInModuleHash () { | ||
const hash = {} | ||
const hash = {} as Record<string, string[]> | ||
builtInModules.forEach(name => hash[name] = require(name)) | ||
return hash | ||
} |
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
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,32 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es6", | ||
"module": "commonjs", | ||
"noImplicitAny": true, | ||
"esModuleInterop": true, | ||
"allowSyntheticDefaultImports": true, | ||
"inlineSourceMap": false, | ||
"allowJs": true, | ||
"lib": [ | ||
"es6", | ||
"es2015", | ||
"es2016" | ||
], | ||
"declaration": true, | ||
"declarationDir": "typings", | ||
"types": [ | ||
"@fibjs/types" | ||
], | ||
"typeRoots": [ | ||
"typings/index.d.ts" | ||
] | ||
}, | ||
"include": [ | ||
"src/**/*", | ||
"src/util/is-builtin-module.ts" | ||
], | ||
"exclude": [ | ||
"src/**/*.js", | ||
"test/**/*" | ||
] | ||
} |