-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/update sudoku exercise (#23)
* Updated sudoku exercise - Moved from custom webpack configuration to use react-scripts to make things simpler. - Upgraded dependencies to latest ones. - Added linting and integration with codacy/codecov. - Added continuous integration examples of how to run tests on push/pull requests and how to "deploy" in github pages upon release. - Updated dockerfile to use an official node image so we don't have to install everything from scratch. - Updated sass examples to make them more interesting.
- Loading branch information
Showing
19 changed files
with
40,059 additions
and
11,685 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"parser": "babel-eslint", | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"jest": true, | ||
"node": true | ||
}, | ||
"settings": { | ||
"react": { | ||
"version": "16.13.1" | ||
} | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"react", | ||
"plugin:react/recommended" | ||
], | ||
"plugins": [ | ||
"react" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Release | ||
|
||
on: release | ||
|
||
jobs: | ||
unit-testing: | ||
name: Unit Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 13 | ||
- name: install dependencies | ||
run: npm install | ||
- name: run tests | ||
run: npm test | ||
|
||
deploy: | ||
name: Deploy to GitHub Pages | ||
runs-on: ubuntu-latest | ||
needs: | ||
- unit-testing | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
- name: Install Packages | ||
run: npm install | ||
- name: Build page | ||
run: npm run build --verbose | ||
env: | ||
CI: false | ||
- name: Deploy to gh-pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | ||
publish_dir: ./build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Testing | ||
|
||
on: push | ||
|
||
jobs: | ||
unit-testing: | ||
name: Unit Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 13 | ||
- name: install dependencies | ||
run: npm install | ||
- name: run tests | ||
run: npm run test:ci | ||
- name: Codecov | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
flags: unittests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,6 @@ typings/ | |
|
||
# next.js build output | ||
.next | ||
|
||
public/css/* | ||
public/js/* | ||
.history/ | ||
.vscode/ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,21 @@ | ||
# -- Dockerfile -- # | ||
# | ||
# docker build -t react-exercise . | ||
# docker run -dit --name react-instance -v `pwd`:/storage/app -p 80:8080 react-exercise | ||
# docker run -dit --name react-instance -p 80:3000 react-exercise | ||
# docker exec -it react-instance /bin/bash | ||
|
||
FROM ubuntu:16.04 | ||
FROM node:12-buster | ||
|
||
LABEL Description="React Sudoku" Version="1.0" | ||
|
||
# Install generic tools | ||
RUN apt-get update && apt-get install -y \ | ||
sudo \ | ||
vim \ | ||
net-tools \ | ||
curl | ||
EXPOSE 3000 | ||
|
||
# Add node source repository to install the latest version | ||
RUN curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - | ||
ARG APP_DIR="/opt/exercise-react" | ||
|
||
# Install basic tools | ||
RUN apt-get update && apt-get install -y \ | ||
nodejs | ||
RUN mkdir -p ${APP_DIR} | ||
WORKDIR ${APP_DIR} | ||
|
||
# Bring the process starter | ||
COPY startup.sh /root/ | ||
RUN chmod +x /root/startup.sh | ||
COPY . ${APP_DIR} | ||
RUN npm install | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT [ "/root/startup.sh" ] | ||
ENTRYPOINT [ "npm", "run", "start" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.