Skip to content

Commit

Permalink
fix: add release structure
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Nov 15, 2020
1 parent e621d6f commit 26e3a10
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,10 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
- name: Build and Deploy GH-Pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd tryonline
npm install --save confidis
npm run deploy
17 changes: 10 additions & 7 deletions jstests/normal-small/normal-small.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ const tests = combos({
})

const testResults = []
let setCommandsRun = 0
const testStartTime = Date.now()
for (const testConfig of tests) {
const {
totalAnswers,
Expand All @@ -137,11 +139,10 @@ for (const testConfig of tests) {
questionConfig: { questions, name: questionConfigName },
sourcesConfig: { name: sourceConfigName, sources },
} = testConfig
const testName = `${
questions.length
} Questions (${knownQuestions} known) w/ ${questionConfigName}, ${totalAnswers} Answers, guess chance: ${Math.round(
(1 / totalUniqueAnswers) * 100
)}%, ${sources.length} Srcs: ${sourceConfigName}`
const testName = `${questions.length
} Questions (${knownQuestions} known) w/ ${questionConfigName}, ${totalAnswers} Answers, guess chance: ${Math.round(
(1 / totalUniqueAnswers) * 100
)}%, ${sources.length} Srcs: ${sourceConfigName}`

const questionChanceOfSelection = questions.reduce(
(acc, q, i) => ({ ...acc, [`q${i}`]: q.answerBias }),
Expand Down Expand Up @@ -179,6 +180,7 @@ for (const testConfig of tests) {
shuffle(knownIndicies, { rng })
knownIndicies = knownIndicies.slice(0, knownQuestions)
for (let i = 0; i < knownIndicies.length; i++) {
setCommandsRun += 1
g.execute_command(`SET q${i} 0 FROM trusted_source`)
questionAnswerFromSource[`q${i}`].trusted_source = 0
sourceAnswers.trusted_source[`q${i}`] = 0
Expand Down Expand Up @@ -209,6 +211,7 @@ for (const testConfig of tests) {
sourceAnswers[selectedSource][selectedQuestion] = answer
const cmdString = `SET ${selectedQuestion} ${answer} FROM ${selectedSource}`
// console.log(cmdString)
setCommandsRun += 1
g.execute_command(cmdString)
numberAnswered++
}
Expand Down Expand Up @@ -298,9 +301,9 @@ test("average scores", (t) => {
)
t.assert(
gAccAvg > mvAccAvg,
`Confidis should beat majority voting on "${
scoreStrings.join(",") || "overall"
`Confidis should beat majority voting on "${scoreStrings.join(",") || "overall"
}"`
)
}
console.log(`Approximate time/1000 sets in ms: ${(Date.now() - testStartTime) / (setCommandsRun / 1000)}`)
})
2 changes: 1 addition & 1 deletion releaserc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
plugins: [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/npm", { npmPublish: true }],
["@semantic-release/npm", { npmPublish: true, pkgRoot: "pkg" }],
"@semantic-release/github",
[
"@semantic-release/git",
Expand Down
2 changes: 1 addition & 1 deletion tryonline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"babel-preset-react-app": "^9.1.2",
"camelcase": "^5.3.1",
"case-sensitive-paths-webpack-plugin": "2.3.0",
"confidis": "^0.1.11",
"confidis": "^1.0.1",
"css-loader": "3.4.2",
"dotenv": "8.2.0",
"dotenv-expand": "5.1.0",
Expand Down
8 changes: 4 additions & 4 deletions tryonline/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3234,10 +3234,10 @@ concat-stream@^1.5.0:
readable-stream "^2.2.2"
typedarray "^0.0.6"

confidis@^0.1.11:
version "0.1.11"
resolved "https://registry.yarnpkg.com/confidis/-/confidis-0.1.11.tgz#75e9ac7fc1159d83f9204711dcc482b478dded46"
integrity sha512-bN/b6xZmmIkfxcFR/F/zN36waNZHQvVyyNhGIDyQ3NPgtjWOfIQvEgb094TK/hSqoYzAx8P9zICnoyjbLf2vbg==
confidis@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/confidis/-/confidis-1.0.1.tgz#d9b2ba2c57783a11f1c7f8e4eec91b128415ca88"
integrity sha512-4yzfKT/+0FXPbngsOW0a9e5EMtax0mSg5MwsW2MSn1wl8cgESIuziklAfm3VYqrO/fgujo962veOR/gHd9alZw==

confusing-browser-globals@^1.0.9:
version "1.0.9"
Expand Down

0 comments on commit 26e3a10

Please sign in to comment.