Skip to content

Commit 48fb9cb

Browse files
committed
Update tests.yml
1 parent 849fda3 commit 48fb9cb

2 files changed

Lines changed: 63 additions & 38 deletions

File tree

.github/workflows/tests.yml

Lines changed: 51 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Automated tests
1+
name: CI
22

33
on:
44
push:
@@ -13,52 +13,70 @@ on:
1313
- '**.md'
1414

1515
jobs:
16-
node:
16+
node_nvmrc:
17+
name: Node .nvmrc
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v3
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version-file: '.nvmrc'
28+
cache: npm
29+
30+
- name: Install package.json
31+
run: npm clean-install --ignore-scripts
32+
33+
- name: Run postinstall scripts
34+
run: npm run postinstall
35+
36+
- name: Run tests
37+
run: npm run test:js
38+
39+
40+
node_active_versions:
1741
name: Node ${{ matrix.node_version }}
42+
runs-on: ubuntu-latest
43+
continue-on-error: ${{ matrix.node_version == 'current' }}
1844

1945
strategy:
2046
fail-fast: false
2147
matrix:
2248
node_version:
49+
- lts/-1
2350
- lts/*
2451
- current
2552

26-
runs-on: ubuntu-latest
27-
28-
# Allow failues for most recent Node release
29-
continue-on-error: ${{ matrix.node_version == 'current' }}
30-
3153
steps:
32-
- name: Checkout
54+
- name: Checkout repository
3355
uses: actions/checkout@v3
3456

35-
- name: Setup
57+
- name: Setup Node.js
3658
uses: actions/setup-node@v3
3759
with:
3860
node-version: ${{ matrix.node_version }}
3961
cache: npm
4062

41-
# See https://github.com/npm/cli/issues/2610
42-
- name: Workaround for Node 14
43-
if: matrix.node_version == '14'
44-
run: sed -i 's/git+ssh/git+https/g' package-lock.json
45-
46-
- name: Install
47-
run: npm clean-install
63+
- name: Install package.json
64+
run: npm clean-install --ignore-scripts
65+
66+
- name: Run postinstall scripts
67+
run: npm run postinstall
4868

49-
- name: Test
50-
run: npm run test
69+
- name: Run tests
70+
run: npm run test:js
5171

5272

5373
docker:
5474
name: Docker
55-
5675
runs-on: ubuntu-latest
57-
5876
continue-on-error: true
5977

6078
steps:
61-
- name: Checkout
79+
- name: Checkout repository
6280
uses: actions/checkout@v3
6381

6482
- name: Build image from Dockerfile
@@ -83,22 +101,29 @@ jobs:
83101
docker run dr4ft-app node --version
84102
echo
85103
docker top dr4ft
86-
104+
87105
88106
lint:
89107
name: ESLint
90-
91108
runs-on: ubuntu-latest
92109

93110
steps:
94-
- name: Checkout
111+
- name: Checkout repository
95112
uses: actions/checkout@v3
96113

97-
- name: Install
114+
- name: Setup Node.js
115+
uses: actions/setup-node@v3
116+
with:
117+
node-version-file: '.nvmrc'
118+
cache: npm
119+
120+
- name: Install package.json
98121
run: npm clean-install --ignore-scripts
99122

100123
- name: Run ESLint
101124
run: |
125+
echo "Node version"
102126
node --version
103-
echo
127+
echo "ESLint version"
128+
npx eslint --version
104129
npm run lint

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

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

11-
*dr4ft* is a <kbd>NodeJS</kbd> based web-application that simulates draft and sealed format between players and/or bots.
12-
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.
11+
*dr4ft* is a <kbd>Node.js</kbd> based web-application that simulates draft and sealed format between players and/or bots.
12+
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.
1313

1414
The application provides the following features:
1515

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

6565
### Native
6666

67-
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.
67+
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.
6868
2) Run<br>
6969
`$ npm ci`<br>
70-
`$ npm run build`<br>
7170
`$ npm start`
7271
3) Visit [http://localhost:1337](http://localhost:1337)
7372

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

8786
### Start Server
8887

89-
`npm start`
90-
This command start the server
88+
- `npm start`
89+
This command starts the server.
9190

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

95-
`npm run update_database`
96-
This command downloads integrates all files previously downloaded from MTGJson.
94+
- `npm run update_database`
95+
This command downloads and integrates all files previously downloaded from MTGJSON.
9796

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

101100
## Development Notes
102101

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

141140
Please make sure to update tests as appropriate.
142141

142+
<br>
143143
<p align='center'>
144144
<sub><i>The project is unaffiliated with Wizards of the Coast, and is licensed under the MIT license.</i></sub>
145145
</p>

0 commit comments

Comments
 (0)