Skip to content

Commit

Permalink
ci: add matrix for compiler/node versions
Browse files Browse the repository at this point in the history
  • Loading branch information
thepiwo committed Sep 18, 2023
1 parent 0d9ba0b commit 8c7d7dd
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 8 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# 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]
Expand All @@ -9,6 +7,23 @@ jobs:
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

Expand All @@ -23,3 +38,7 @@ jobs:
- 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 }}
5 changes: 4 additions & 1 deletion docs/cli/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ 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 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)
});

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

0 comments on commit 8c7d7dd

Please sign in to comment.