From 19be04eab27d96910088ed9dde40b7697d0e54ee Mon Sep 17 00:00:00 2001 From: dcode Date: Sun, 22 Sep 2019 15:09:03 +0200 Subject: [PATCH 1/4] Switch to GitHub Actions --- .github/workflows/ci.yaml | 96 +++++++++++++++++++++++++++++++++++++++ .travis.yml | 27 ----------- scripts/check-pr.sh | 29 ------------ 3 files changed, 96 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/ci.yaml delete mode 100644 .travis.yml delete mode 100755 scripts/check-pr.sh diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000000..877f9ffb1e --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,96 @@ +name: CI +on: [push, pull_request] +jobs: + check: + name: "Check preconditions" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1.0.0 + - name: "Check that author is present in the NOTICE file" + run: | + AUTHOR=$(git log -1 --format="%aE") + if [ -z "$AUTHOR" ]; then + printf "\Cannot perform NOTICE check: Commit does not include an email address.\n" && + exit 1; + elif ! grep -q "$AUTHOR" NOTICE || false; then + printf "\nAuthor '$AUTHOR' does not appear to be listed in the NOTICE file, yet.\n" && + printf "Please see https://github.com/AssemblyScript/assemblyscript/blob/master/CONTRIBUTING.md\n" && + exit 1; + else + printf "\nOK: Author is present in the NOTICE file.\n"; + fi + - name: "If a PR, check that distribution files are unmodified" + if: github.event_name == 'pull_request' + run: | + if git --no-pager diff --name-only $(git rev-parse origin/${{ github.base_ref }})...${{ github.sha }} | grep -q "^dist/"; then + printf "\nThe pull request modifies distribution files, but it shouldn't.\n" && + printf "Please see https://github.com/AssemblyScript/assemblyscript/blob/master/CONTRIBUTING.md\n" && + exit 1; + else + printf "\nOK: Distributions files have not been modified.\n"; + fi + test: + name: "Test compiler on node: ${{ matrix.node_version }}" + runs-on: ubuntu-latest + needs: check + strategy: + matrix: + node_version: ["lts/*", "node"] + steps: + - uses: actions/checkout@v1.0.0 + - uses: dcodeIO/setup-node-nvm@v1.0.0 + with: + node-version: ${{ matrix.node_version }} + - name: Install dependencies + run: npm ci --no-audit + - name: Clean distribution files + run: npm run clean + - name: Test sources + run: npm test + - name: Build distribution files + run: npm run build + - name: Test distribution + run: npm test + test-canary: + name: "Test features on node: v8-canary" + runs-on: ubuntu-latest + needs: check + steps: + - uses: actions/checkout@v1.0.0 + - uses: dcodeIO/setup-node-nvm@v1.0.0 + with: + node-mirror: https://nodejs.org/download/v8-canary/ + - name: Install dependencies + run: npm ci --no-audit + - name: Clean distribution files + run: npm run clean + - name: Test experimental features + env: + ASC_FEATURES: mutable-globals,simd,threads,reference-types,bigint-integration + run: | + npm run test:compiler rt/flags features/js-bigint-integration features/reference-types features/simd features/threads + test-runtime: + name: "Test runtimes on node: node" + runs-on: ubuntu-latest + needs: check + steps: + - uses: actions/checkout@v1.0.0 + - uses: dcodeIO/setup-node-nvm@v1.0.0 + with: + node-version: node + - name: Install dependencies + run: npm ci --no-audit + - name: Clean distribution files + run: npm run clean + - name: Test full runtime + run: | + cd tests/allocators/rt-full + npm run build + cd .. + npm test rt-full + - name: Test stub runtime + run: | + cd tests/allocators/rt-stub + npm run build + cd .. + npm test rt-stub diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 429f33eb86..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: node_js -notifications: - email: false -before_install: npm config set progress=false && npm i -g npm@latest --no-audit -install: npm ci --no-audit -jobs: - include: - - node_js: lts/* - script: - - if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ "$TRAVIS_PULL_REQUEST_BRANCH" != "dev" ]; then ./scripts/check-pr.sh; fi - - npm run all - - if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - cd $TRAVIS_BUILD_DIR/tests/allocators/rt-full && npm run build && cd .. && npm test rt-full && - cd $TRAVIS_BUILD_DIR/tests/allocators/rt-stub && npm run build && cd .. && npm test rt-stub; - fi - env: Runs the tests on node.js LTS, also tests allocators - - node_js: node - script: - - npm run all - env: Runs the tests on node.js stable - - node_js: node - script: - - npm run clean && npm run test:compiler rt/flags threads - env: - - Runs experimental tests on node.js v8-canary using - - ASC_FEATURES="mutable-globals,simd,threads,reference-types,bigint-integration" - - NVM_NODEJS_ORG_MIRROR="https://nodejs.org/download/v8-canary/" diff --git a/scripts/check-pr.sh b/scripts/check-pr.sh deleted file mode 100755 index 1657439c26..0000000000 --- a/scripts/check-pr.sh +++ /dev/null @@ -1,29 +0,0 @@ -# Distribution files should not be modified -STATUS=0 -if git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD $TRAVIS_BRANCH) | grep -q "^dist/"; then - STATUS=1 && - printf "\n" && - printf "The pull request includes changes to distribution files, but it shouldn't.\n" && - printf "Please see https://github.com/AssemblyScript/assemblyscript/blob/master/CONTRIBUTING.md\n"; -else - printf "\n" && - printf "GOOD: The pull request does not include changes to distribution files.\n"; -fi - -# Authors should have added themself to the NOTICE file -AUTHOR=$(git log -1 --format="%aE") -if [ -z "$AUTHOR" ]; then - printf "\n" && - printf "Skipping NOTICE check: Commit does not include an email address.\n"; -else - if grep -q "$AUTHOR" NOTICE; then - printf "\n" && - printf "GOOD: Author is present in the NOTICE file.\n"; - else - printf "\n" && - printf "Author does not appear to be listed in the NOTICE file, yet.\n" && - printf "Please see https://github.com/AssemblyScript/assemblyscript/blob/master/CONTRIBUTING.md\n"; - fi -fi - -exit $STATUS From 88c1788fc069c23e27cf4a576d9e3801bed9a969 Mon Sep 17 00:00:00 2001 From: dcode Date: Sun, 22 Sep 2019 15:21:27 +0200 Subject: [PATCH 2/4] skip SIMD tests, still broken in node v8-canary --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 877f9ffb1e..abd44054ae 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -66,9 +66,9 @@ jobs: run: npm run clean - name: Test experimental features env: - ASC_FEATURES: mutable-globals,simd,threads,reference-types,bigint-integration + ASC_FEATURES: mutable-globals,threads,reference-types,bigint-integration run: | - npm run test:compiler rt/flags features/js-bigint-integration features/reference-types features/simd features/threads + npm run test:compiler rt/flags features/js-bigint-integration features/reference-types features/threads test-runtime: name: "Test runtimes on node: node" runs-on: ubuntu-latest From 77c9190842242d79d3664262cda71d899642fd7a Mon Sep 17 00:00:00 2001 From: dcode Date: Sun, 22 Sep 2019 15:27:37 +0200 Subject: [PATCH 3/4] yml, update badge --- .github/workflows/{ci.yaml => ci.yml} | 0 README.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{ci.yaml => ci.yml} (100%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/ci.yaml rename to .github/workflows/ci.yml diff --git a/README.md b/README.md index b15607624c..fbb38015fe 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ![](https://avatars1.githubusercontent.com/u/28916798?s=64) AssemblyScript ================= -[![Build Status](https://travis-ci.org/AssemblyScript/assemblyscript.svg?branch=master)](https://travis-ci.org/AssemblyScript/assemblyscript) +[![Actions Status](https://github.com/AssemblyScript/assemblyscript/workflows/ci.yml/badge.svg)](https://github.com/AssemblyScript/assemblyscript/actions) **AssemblyScript** compiles a strict subset of [TypeScript](http://www.typescriptlang.org) (basically JavaScript with types) to [WebAssembly](http://webassembly.org) using [Binaryen](https://github.com/WebAssembly/binaryen). It generates lean and mean WebAssembly modules while being just an `npm install` away. From 07be35b620db2439c5d5df3634aa4a799849a252 Mon Sep 17 00:00:00 2001 From: dcode Date: Sun, 22 Sep 2019 15:32:58 +0200 Subject: [PATCH 4/4] use workflow name to be sure --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fbb38015fe..cab6d26d1f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ![](https://avatars1.githubusercontent.com/u/28916798?s=64) AssemblyScript ================= -[![Actions Status](https://github.com/AssemblyScript/assemblyscript/workflows/ci.yml/badge.svg)](https://github.com/AssemblyScript/assemblyscript/actions) +[![Actions Status](https://github.com/AssemblyScript/assemblyscript/workflows/CI/badge.svg)](https://github.com/AssemblyScript/assemblyscript/actions) **AssemblyScript** compiles a strict subset of [TypeScript](http://www.typescriptlang.org) (basically JavaScript with types) to [WebAssembly](http://webassembly.org) using [Binaryen](https://github.com/WebAssembly/binaryen). It generates lean and mean WebAssembly modules while being just an `npm install` away.