|
| 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 |
0 commit comments