diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5effef28c..376419638 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,12 +33,15 @@ jobs: with: fetch-depth: 2 submodules: recursive - - run: sudo apt-get update - - run: sudo apt-get install -y libxml2-utils - - name: Setup Node.js environment - uses: actions/setup-node@v2 + - uses: docker/setup-buildx-action@v2 + - uses: docker/build-push-action@v4 with: - node-version: ${{ matrix.node }} - cache: 'npm' - - run: npm install - - run: npm run test + context: . + file: Dockerfile.${{ matrix.node}} + tags: 'test' + load: true + push: false + - uses: addnab/docker-run-action@v3 + with: + image: test + run: npm run test diff --git a/Dockerfile.16 b/Dockerfile.16 new file mode 100644 index 000000000..ebf5d818c --- /dev/null +++ b/Dockerfile.16 @@ -0,0 +1,10 @@ +FROM node:16 +RUN apt-get update +RUN apt-get install -y libxml2-utils +RUN mkdir /app +ADD ./packages /app/packages +COPY package.json package-lock.json turbo.json /app/ +WORKDIR /app +RUN npm install +RUN npm run build +CMD ["npm", "run", "test"] \ No newline at end of file diff --git a/Dockerfile.18 b/Dockerfile.18 new file mode 100644 index 000000000..93e901f53 --- /dev/null +++ b/Dockerfile.18 @@ -0,0 +1,10 @@ +FROM node:18 +RUN apt-get update +RUN apt-get install -y libxml2-utils +RUN mkdir /app +ADD ./packages /app/packages +COPY package.json package-lock.json turbo.json /app/ +WORKDIR /app +RUN npm install +RUN npm run build +CMD ["npm", "run", "test"] \ No newline at end of file diff --git a/package.json b/package.json index 041314c41..979f16cb6 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "lint": "turbo run lint", "lint:format": "turbo run lint:format", "test": "turbo run test", + "test:docker": "docker build -t test -f Dockerfile.18 . && docker run test", "format": "prettier --write \"**/*.{ts,tsx,md}\"", "changeset": "changeset", "version": "changeset version && npm install", diff --git a/packages/myst-to-jats/jest.config.cjs b/packages/myst-to-jats/jest.config.cjs index 12a5f074e..79c0bc362 100644 --- a/packages/myst-to-jats/jest.config.cjs +++ b/packages/myst-to-jats/jest.config.cjs @@ -17,7 +17,7 @@ module.exports = { verbose: true, testEnvironment: 'node', transformIgnorePatterns: [ - '/node_modules/(?!(vfile|formdata-polyfill|chalk|fetch-blob|vfile-message|unified|bail|trough|zwitch|unist-|hast-|html-|rehype-|mdast-|micromark-|trim-|web-namespaces|property-information|space-separated-tokens|comma-separated-tokens|get-port|stringify-entities|character-entities-html4|ccount))', + '/node_modules/(?!(vfile|formdata-polyfill|chalk|fetch-blob|vfile-message|unified|bail|trough|zwitch|unist-|hast-|html-|rehype-|mdast-|micromark-|trim-|web-namespaces|property-information|space-separated-tokens|comma-separated-tokens|get-port|stringify-entities|character-entities-html4|ccount|is-plain-obj|nanoid))', ], testPathIgnorePatterns: ['/node_modules/', '/.yalc/', '/dist/'], }; diff --git a/packages/myst-to-jats/package.json b/packages/myst-to-jats/package.json index 3407ba0b4..64782b80d 100644 --- a/packages/myst-to-jats/package.json +++ b/packages/myst-to-jats/package.json @@ -50,13 +50,18 @@ "myst-frontmatter": "^0.0.12", "myst-spec": "^0.0.4", "myst-spec-ext": "^0.0.10", + "unified": "^10.1.2", "unist-util-select": "^4.0.3", "vfile-reporter": "^7.0.4", "xml-js": "^1.6.11" }, "devDependencies": { "@types/jest": "^28.1.6", + "@types/js-yaml": "^4.0.5", + "@types/mdast": "^3.0.11", "jest": "^28.1.3", + "js-yaml": "^4.1.0", + "myst-cli-utils": "^0.0.11", "npm-run-all": "^4.1.5", "prettier": "^2.6.1", "rimraf": "^3.0.2",