Skip to content

Commit

Permalink
Update tests.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tooomm committed Jun 16, 2022
1 parent 849fda3 commit 48fb9cb
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 38 deletions.
77 changes: 51 additions & 26 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Automated tests
name: CI

on:
push:
Expand All @@ -13,52 +13,70 @@ on:
- '**.md'

jobs:
node:
node_nvmrc:
name: Node .nvmrc
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: npm

- name: Install package.json
run: npm clean-install --ignore-scripts

- name: Run postinstall scripts
run: npm run postinstall

- name: Run tests
run: npm run test:js


node_active_versions:
name: Node ${{ matrix.node_version }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.node_version == 'current' }}

strategy:
fail-fast: false
matrix:
node_version:
- lts/-1
- lts/*
- current

runs-on: ubuntu-latest

# Allow failues for most recent Node release
continue-on-error: ${{ matrix.node_version == 'current' }}

steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
cache: npm

# See https://github.com/npm/cli/issues/2610
- name: Workaround for Node 14
if: matrix.node_version == '14'
run: sed -i 's/git+ssh/git+https/g' package-lock.json

- name: Install
run: npm clean-install
- name: Install package.json
run: npm clean-install --ignore-scripts

- name: Run postinstall scripts
run: npm run postinstall

- name: Test
run: npm run test
- name: Run tests
run: npm run test:js


docker:
name: Docker

runs-on: ubuntu-latest

continue-on-error: true

steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v3

- name: Build image from Dockerfile
Expand All @@ -83,22 +101,29 @@ jobs:
docker run dr4ft-app node --version
echo
docker top dr4ft
lint:
name: ESLint

runs-on: ubuntu-latest

steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v3

- name: Install
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: npm

- name: Install package.json
run: npm clean-install --ignore-scripts

- name: Run ESLint
run: |
echo "Node version"
node --version
echo
echo "ESLint version"
npx eslint --version
npm run lint
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

# dr4ft [![Discord](https://img.shields.io/discord/224178957103136779?label=Discord&logo=discord&logoColor=white&color=7289da)](https://mtgjson.com/discord)

*dr4ft* is a <kbd>NodeJS</kbd> based web-application that simulates draft and sealed format between players and/or bots.
Most of MTG sets are playable thanks to MTGJson support. We follow as much as possible the rules that determine how a real booster is created.
*dr4ft* is a <kbd>Node.js</kbd> based web-application that simulates draft and sealed format between players and/or bots.
Most of MTG sets are playable thanks to MTGJSON support. We follow as much as possible the rules that determine how a real booster is created.

The application provides the following features:

Expand Down Expand Up @@ -64,10 +64,9 @@ It supports all their features, and many more.

### Native

1) Install [Node.js](https://nodejs.org/en/download/) >= 16.0.0. Alternatively, install [nvm](https://github.com/nvm-sh/nvm) and then run `nvm use` in this repo, which will install the correct Node version for this repo as defined in the `.nvmrc` file.
1) Install [Node.js](https://nodejs.org/en/download/) >= 16.0.0<br> Alternatively, install [nvm](https://github.com/nvm-sh/nvm) and run `nvm use` in the project root to install a correct Node version for this repo as defined in the [`.nvmrc`](.nvmrc) file.
2) Run<br>
`$ npm ci`<br>
`$ npm run build`<br>
`$ npm start`
3) Visit [http://localhost:1337](http://localhost:1337)

Expand All @@ -86,17 +85,17 @@ You can also create a Docker image and run the app in a container:

### Start Server

`npm start`
This command start the server
- `npm start`
This command starts the server.

`npm run download_allsets`
This command downloads all sets from MTGJson and integrates them.
- `npm run download_allsets`
This command downloads all sets from [MTGJSON](https://mtgjson.com) and integrates them.

`npm run update_database`
This command downloads integrates all files previously downloaded from MTGJson.
- `npm run update_database`
This command downloads and integrates all files previously downloaded from MTGJSON.

`npm run download_booster_rules`
download and parse booster generation rules from [magic-sealed-data](https://github.com/taw/magic-sealed-data)
- `npm run download_booster_rules`
This command downloads and parses booster generation rules from [taw/magic-sealed-data](https://github.com/taw/magic-sealed-data)

## Development Notes

Expand Down Expand Up @@ -140,6 +139,7 @@ Pull requests are welcome. For major changes, please open an issue first to disc

Please make sure to update tests as appropriate.

<br>
<p align='center'>
<sub><i>The project is unaffiliated with Wizards of the Coast, and is licensed under the MIT license.</i></sub>
</p>
Expand Down

0 comments on commit 48fb9cb

Please sign in to comment.