Skip to content

Commit

Permalink
🐳 Try running tests in docker
Browse files Browse the repository at this point in the history
  • Loading branch information
fwkoch authored Apr 24, 2023
1 parent f744013 commit 541bb14
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 9 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 10 additions & 0 deletions Dockerfile.16
Original file line number Diff line number Diff line change
@@ -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"]
10 changes: 10 additions & 0 deletions Dockerfile.18
Original file line number Diff line number Diff line change
@@ -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"]
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/myst-to-jats/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
verbose: true,
testEnvironment: 'node',
transformIgnorePatterns: [
'<rootDir>/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))',
'<rootDir>/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/'],
};
5 changes: 5 additions & 0 deletions packages/myst-to-jats/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 541bb14

Please sign in to comment.