Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: use matrix test suite #497

Merged
merged 2 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 28 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,44 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Build and Test

on: [push]

jobs:
build-and-test:
strategy:
matrix:
node-version: [ 16, 18, 20 ]
node-tag: [latest]
compiler-tag: [latest]

# for lts node also test first known compatible and latest known good compiler and node versions
include:
- node-version: 18
node-tag: v6.8.0 # v6.3.0 to v6.7.0 use a different config format
compiler-tag: latest
- node-version: 18
node-tag: v6.11.0
compiler-tag: latest
- node-version: 18
node-tag: latest
compiler-tag: v7.5.0
- node-version: 18
node-tag: latest
compiler-tag: v7.6.0

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@master
- name: Use Node.js 16.x
uses: actions/setup-node@v1
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build:clean && npm run build
- run: npm run lint:ci
- run: npm test
env:
NODE_VERSION: ${{ matrix.node-version }}
NODE_TAG: ${{ matrix.node-tag }}
COMPILER_TAG: ${{ matrix.compiler-tag }}
6 changes: 5 additions & 1 deletion docs/cli/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ aeproject env --info

**Note**: By default AEproject uses the `latest-bundle` tag of the official [docker images](https://hub.docker.com/r/aeternity/aeternity/tags).

**Compatibility**: AEproject uses `@aeternity/aepp-sdk@13` which is only compatible using `node >= v6` and `compiler >= v7`, the only tested and recommended configuration, which also works on ARM64/Apple Silicon is from images `node v6.8.1` and `compiler v7.3.0`, upcoming newer versions with the same major version should work without issues.
**Compatibility**:
- aeproject uses the `-bundle` node docker images including dev mode, which are only published from `NODE_TAG >= v6.3.0`
- the default `aeternity.yaml` config file that ships with aeproject supports `NODE_TAG >= v6.8.0`
- the latest `@aeternity/aepp-sdk@13` is only compatible using `NODE_TAG >= v6.0.0` and `COMPILER_TAG >= v7.5.0`
- ARM64/Apple Silicon is supported from images `NODE_TAG >= v6.8.1` and `COMPILER_TAG >= v7.3.0`

## Disclaimer
- Firewalls and any other security feature can block your docker/docker-compose requests. Please check that docker/docker-compose is NOT in its blocked list or has permission to make requests.
20 changes: 15 additions & 5 deletions tests/happy-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const chai = require('chai');
const chaiFiles = require('chai-files');
const { isEnvRunning } = require('../src/env/env');
const { version } = require('../package.json');
const { print } = require("../src/utils/utils");

chai.use(chaiFiles);
const { assert } = chai;
Expand Down Expand Up @@ -60,12 +61,15 @@ describe('Happy Path', () => {
assert.equal(res.code, 0);
assert.isTrue(await isEnvRunning(cwd));

const resSecond = await exec('aeproject env --nodeVersion v6.10.0 --compilerVersion v7.4.0', { cwd });
assert.include(resSecond.stdout, 'v6.10.0');
assert.include(resSecond.stdout, 'v7.4.0');
// don't run for all gh-action matrix tests
if (process.env.NODE_TAG === 'latest' && process.env.COMPILER_TAG === 'latest' && process.env.NODE_VERSION === '18') {
const resSecond = await exec('aeproject env --nodeVersion v6.10.0 --compilerVersion v7.4.0', { cwd });
assert.include(resSecond.stdout, 'v6.10.0');
assert.include(resSecond.stdout, 'v7.4.0');

const resThird = await exec('aeproject env', { cwd });
assert.include(resThird.stdout, 'updating');
const resThird = await exec('aeproject env', { cwd });
assert.include(resThird.stdout, 'updating');
} else print('skipping env version and update tests')
});

it('env --restart', async () => {
Expand All @@ -74,6 +78,12 @@ describe('Happy Path', () => {
assert.isTrue(await isEnvRunning(cwd));
});

it('env --info', async () => {
const res = await exec('aeproject env --info', { cwd });
assert.equal(res.code, 0);
print(res.stdout)
kenodressel marked this conversation as resolved.
Show resolved Hide resolved
});

it('test', async () => {
const res = await exec('aeproject test', { cwd });
assert.equal(res.code, 0);
Expand Down