Skip to content

Commit 1e8a5f9

Browse files
authored
Switch to GitHub Actions (AssemblyScript#861)
1 parent 812f2eb commit 1e8a5f9

File tree

4 files changed

+97
-57
lines changed

4 files changed

+97
-57
lines changed

.github/workflows/ci.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: CI
2+
on: [push, pull_request]
3+
jobs:
4+
check:
5+
name: "Check preconditions"
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v1.0.0
9+
- name: "Check that author is present in the NOTICE file"
10+
run: |
11+
AUTHOR=$(git log -1 --format="%aE")
12+
if [ -z "$AUTHOR" ]; then
13+
printf "\Cannot perform NOTICE check: Commit does not include an email address.\n" &&
14+
exit 1;
15+
elif ! grep -q "$AUTHOR" NOTICE || false; then
16+
printf "\nAuthor '$AUTHOR' does not appear to be listed in the NOTICE file, yet.\n" &&
17+
printf "Please see https://github.com/AssemblyScript/assemblyscript/blob/master/CONTRIBUTING.md\n" &&
18+
exit 1;
19+
else
20+
printf "\nOK: Author is present in the NOTICE file.\n";
21+
fi
22+
- name: "If a PR, check that distribution files are unmodified"
23+
if: github.event_name == 'pull_request'
24+
run: |
25+
if git --no-pager diff --name-only $(git rev-parse origin/${{ github.base_ref }})...${{ github.sha }} | grep -q "^dist/"; then
26+
printf "\nThe pull request modifies distribution files, but it shouldn't.\n" &&
27+
printf "Please see https://github.com/AssemblyScript/assemblyscript/blob/master/CONTRIBUTING.md\n" &&
28+
exit 1;
29+
else
30+
printf "\nOK: Distributions files have not been modified.\n";
31+
fi
32+
test:
33+
name: "Test compiler on node: ${{ matrix.node_version }}"
34+
runs-on: ubuntu-latest
35+
needs: check
36+
strategy:
37+
matrix:
38+
node_version: ["lts/*", "node"]
39+
steps:
40+
- uses: actions/checkout@v1.0.0
41+
- uses: dcodeIO/setup-node-nvm@v1.0.0
42+
with:
43+
node-version: ${{ matrix.node_version }}
44+
- name: Install dependencies
45+
run: npm ci --no-audit
46+
- name: Clean distribution files
47+
run: npm run clean
48+
- name: Test sources
49+
run: npm test
50+
- name: Build distribution files
51+
run: npm run build
52+
- name: Test distribution
53+
run: npm test
54+
test-canary:
55+
name: "Test features on node: v8-canary"
56+
runs-on: ubuntu-latest
57+
needs: check
58+
steps:
59+
- uses: actions/checkout@v1.0.0
60+
- uses: dcodeIO/setup-node-nvm@v1.0.0
61+
with:
62+
node-mirror: https://nodejs.org/download/v8-canary/
63+
- name: Install dependencies
64+
run: npm ci --no-audit
65+
- name: Clean distribution files
66+
run: npm run clean
67+
- name: Test experimental features
68+
env:
69+
ASC_FEATURES: mutable-globals,threads,reference-types,bigint-integration
70+
run: |
71+
npm run test:compiler rt/flags features/js-bigint-integration features/reference-types features/threads
72+
test-runtime:
73+
name: "Test runtimes on node: node"
74+
runs-on: ubuntu-latest
75+
needs: check
76+
steps:
77+
- uses: actions/checkout@v1.0.0
78+
- uses: dcodeIO/setup-node-nvm@v1.0.0
79+
with:
80+
node-version: node
81+
- name: Install dependencies
82+
run: npm ci --no-audit
83+
- name: Clean distribution files
84+
run: npm run clean
85+
- name: Test full runtime
86+
run: |
87+
cd tests/allocators/rt-full
88+
npm run build
89+
cd ..
90+
npm test rt-full
91+
- name: Test stub runtime
92+
run: |
93+
cd tests/allocators/rt-stub
94+
npm run build
95+
cd ..
96+
npm test rt-stub

.travis.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
![](https://avatars1.githubusercontent.com/u/28916798?s=64) AssemblyScript
22
=================
33

4-
[![Build Status](https://travis-ci.org/AssemblyScript/assemblyscript.svg?branch=master)](https://travis-ci.org/AssemblyScript/assemblyscript)
4+
[![Actions Status](https://github.com/AssemblyScript/assemblyscript/workflows/CI/badge.svg)](https://github.com/AssemblyScript/assemblyscript/actions)
55

66
**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.
77

scripts/check-pr.sh

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)