Skip to content

Commit 600e21b

Browse files
Merge branch 'master' into feat/2020-day-08
2 parents 12967ca + 8d0c3e2 commit 600e21b

31 files changed

+4416
-797
lines changed

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a successful unit test
2+
# has been run on master.
3+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
4+
5+
name: Release
6+
7+
on:
8+
workflow_run:
9+
workflows: ["Run Tests"]
10+
branches: [master]
11+
types:
12+
- completed
13+
14+
jobs:
15+
release:
16+
name: Semantic Release
17+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
- uses: actions/setup-node@v2
23+
with:
24+
node-version: 14
25+
- run: npm ci
26+
- name: Semantic Release
27+
uses: cycjimmy/semantic-release-action@v2.3.0
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
31+
32+
# publish-gpr:
33+
# name: Release to GitHub Packages
34+
# needs: release
35+
# runs-on: ubuntu-latest
36+
# steps:
37+
# - uses: actions/checkout@v2
38+
# - uses: actions/setup-node@v2
39+
# with:
40+
# node-version: 12
41+
# registry-url: https://npm.pkg.github.com/
42+
# - run: npm ci
43+
# - run: npm publish
44+
# env:
45+
# NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/run-tests.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Run Tests
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
test:
14+
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
node-version: ['14']
20+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v2
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
- run: npm ci
29+
- run: npm run build --if-present
30+
- run: npm test && npm run report-coverage

.travis.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

2018/day-03/claims.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const unique = require('../helpers').unique
22

3-
var _conflicts = []
4-
var _claims = []
5-
var _cloth = []
3+
let _conflicts = []
4+
let _claims = []
5+
let _cloth = []
66

77
/**
88
* Generates an empty matrix of X columns and Y rows

2018/day-03/claims.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-env mocha */
22
const expect = require('chai').expect
3-
var {
3+
const {
44
_cloth,
55
countConflicts,
66
findNonOverlappingClaims,

2018/day-10/beacons.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Beacon {
3030
const data = {}
3131
// Calculate the position of all the beacons
3232
data.contents = this.start.map((beacon) => {
33-
var point = {}
33+
const point = {}
3434
Object.keys(beacon.position).forEach((key) => {
3535
point[key] = beacon.position[key] + (frame * beacon.velocity[key])
3636
})

2018/day-10/solution.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ const init = (data) => {
1919

2020
// Find the frame with the best focus
2121
const best = beaconTracker.frameMeta.reduce((acc, curr, idx) => {
22-
return (curr.focus < acc.focus) ? {
23-
idx: idx,
24-
focus: curr.focus,
25-
dims: curr.dims
26-
} : acc
22+
return (curr.focus < acc.focus)
23+
? {
24+
idx: idx,
25+
focus: curr.focus,
26+
dims: curr.dims
27+
}
28+
: acc
2729
}, { idx: 0, focus: beaconTracker.frameMeta[0].focus, dims: { dim: [0, 0], origin: [0, 0] } })
2830

2931
// const answer = sumMetadata(data)

2018/day-11/fuel-cells.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ class Rack {
7979
return null // break for speed on invalid squares
8080
}
8181
const dest = this.cells[pointer]
82-
if (!dest) {
83-
84-
}
8582
power += (dest) ? dest.power : 0
8683
}
8784
}

2018/day-13/tracks.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ class Track {
5959
(this.trackTurns.indexOf(s) === 0 && a === 'x') // horizontal turns clockwise
6060
// (this.trackTurns.indexOf(s) === 0 && a === 'x') // horizontal turns counter-clockwise
6161
// (this.trackTurns.indexOf(s) === 1 && a === 'y') // vertical turns counter-clockwise
62-
) ? 1 : -1
62+
)
63+
? 1
64+
: -1
6365
// Find the value of the new direction
6466
return this.cartDirections[this._roationDirection(d, r)]
6567
}

2020/day-09/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// eslint-disable-next-line no-unused-vars
2+
const console = require('../helpers')
3+
require('./solution')

0 commit comments

Comments
 (0)