Skip to content

Commit

Permalink
Merge pull request #302 from opentripplanner/dev
Browse files Browse the repository at this point in the history
Merge TravisCI replacement with GitHub Actions to master
  • Loading branch information
evansiroky authored Jan 8, 2021
2 parents 3bdc600 + 2672afa commit 0a3887d
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 36 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# GitHub Action to automate the identification of common misspellings in text files.
# https://github.com/codespell-project/actions-codespell
# https://github.com/codespell-project/codespell
name: codespell
on: pull_request
jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: codespell-project/actions-codespell@master
with:
check_filenames: true
skip: ./.git,yarn.lock
41 changes: 41 additions & 0 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Node.js CI

on:
push:
branches:
- master
pull_request:

jobs:
test-build-release:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install npm packages using cache
uses: bahmutov/npm-install@v1
- name: Copy example config
run: cp example-config.yml config.yml
- name: Lint code
run: yarn lint
- name: Lint docs
run: yarn lint-docs
- name: Run tests with coverage
run: yarn cover
- name: Build example project
run: yarn build

# at this point, the build is successful
- name: Codecov
uses: codecov/[email protected]
continue-on-error: true
- name: Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn semantic-release
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

4 changes: 4 additions & 0 deletions example-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,7 @@ itinerary:
# phoneFormatOptions:
# # ISO 2-letter country code for phone number formats (defaults to 'US')
# countryCode: US

# Format the date time format for display.
dateTime:
longDateFormat: DD-MM-YYYY
2 changes: 1 addition & 1 deletion lib/actions/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ export function carRentalQuery (params) {
return createQueryAction('car_rental', carRentalResponse, carRentalError)
}

// Vehicle rental locations lookup query. For now, there are 3 seperate
// Vehicle rental locations lookup query. For now, there are 3 separate
// "vehicle" rental endpoints - 1 for cars, 1 for bicycle rentals and another
// for micromobility. In the future, the hope is to consolidate these 3
// endpoints into one.
Expand Down
4 changes: 2 additions & 2 deletions lib/actions/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function fetchAuth0Token (auth0) {

dispatch(setCurrentUser({ accessToken }))
} catch (error) {
// TODO: improve UI if there is an errror.
// TODO: improve UI if there is an error.
alert('Error obtaining an authorization token.')
}
}
Expand Down Expand Up @@ -257,7 +257,7 @@ export function requestPhoneVerificationSms (newPhoneNumber) {
const now = new Date()

// Request a new verification code if we are requesting a different number.
// or enough time has ellapsed since the last request (1 minute?).
// or enough time has elapsed since the last request (1 minute?).
// TODO: Should throttling be handled in the middleware?
if (number !== newPhoneNumber || (now - timestamp) >= 60000) {
const { accessToken, apiBaseUrl, apiKey, loggedInUser } = getMiddlewareVariables(state)
Expand Down
4 changes: 2 additions & 2 deletions lib/components/user/notification-prefs-pane.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const allowedNotificationChannels = [
]

// Styles
// HACK: Preverve container height.
// HACK: Preserve container height.
const Details = styled.div`
min-height: 150px;
margin-bottom: 15px;
Expand Down Expand Up @@ -132,7 +132,7 @@ const NotificationPrefsPane = ({
bsStyle={notificationChannel === type ? 'primary' : 'default'}
key={index}
// onBlur and onChange have to be set on individual controls instead of the control group
// in order for Formik to correcly process the changes.
// in order for Formik to correctly process the changes.
onBlur={handleBlur}
onChange={handleChange}
value={type}
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export {
TripDetails,
TripTools,

// mobile compoments
// mobile components
MobileMain,

// viewer components
Expand Down
10 changes: 5 additions & 5 deletions lib/reducers/create-otp-reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ const MAX_RECENT_STORAGE = 5
* Validates the initial state of the store. This is intended to mainly catch
* configuration issues since a manually edited config file is loaded into the
* initial state.
* TODO: mabye it's a better idea to move all of this to a script that can do
* TODO: maybe it's a better idea to move all of this to a script that can do
* JSON Schema validation and other stuff.
*/
function validateInitalState (initialState) {
function validateInitialState (initialState) {
const {config} = initialState

const errors = []
Expand Down Expand Up @@ -237,8 +237,8 @@ export function getInitialState (userDefinedConfig, initialQuery) {

function createOtpReducer (config, initialQuery) {
const initialState = getInitialState(config, initialQuery)
// validate the inital state
validateInitalState(initialState)
// validate the initial state
validateInitialState(initialState)

return (state = initialState, action) => {
const searchId = action.payload && action.payload.searchId
Expand Down Expand Up @@ -560,7 +560,7 @@ function createOtpReducer (config, initialQuery) {
if (duplicateIndex !== -1) searches[duplicateIndex] = action.payload
else searches.unshift(action.payload)
const sortedSearches = searches.sort((a, b) => b.timestamp - a.timestamp)
// Ensure recent searches do not extend beyong MAX_RECENT_STORAGE
// Ensure recent searches do not extend beyond MAX_RECENT_STORAGE
if (sortedSearches.length >= MAX_RECENT_STORAGE) {
sortedSearches.splice(MAX_RECENT_STORAGE)
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"prepublish": "mastarm prepublish --config configurations/prepublish",
"prestart": "yarn",
"test": "yarn run lint && yarn run lint-docs && yarn run jest",
"semantic-release": "semantic-release",
"start": "mastarm build -e development --serve example.js"
},
"standard": {
Expand Down

0 comments on commit 0a3887d

Please sign in to comment.