Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi Delgatte committed Jun 20, 2019
0 parents commit 026bcfd
Show file tree
Hide file tree
Showing 20 changed files with 845 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: 2
jobs:
build:
docker:
- image: circleci/node:lts-jessie

working_directory: ~/repo

steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- run:
name: Build and install dependencies
command: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
# run tests!
- run:
name: Run tests with JUnit as reporter
command: ./node_modules/.bin/jest --collect-coverage --ci --runInBand --reporters=default --reporters=jest-junit
environment:
JEST_JUNIT_OUTPUT_DIR: test-results
- store_artifacts:
path: coverage
- store_test_results:
path: test-results

10 changes: 10 additions & 0 deletions .github/label-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- regExp: ".*\\.ts+$"
labels: ["typescript"]
- regExp: ".*\\.sql+$"
labels: ["database", "critical"]
- regExp: ".*\\.md+$"
labels: ["documentation"]
- regExp: ".*\\.png+$"
labels: ["images"]
- regExp: ".*\\.(zip|jar|war|ear)+$"
labels: ["artifact", "invalid"]
9 changes: 9 additions & 0 deletions .github/main.workflow
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
workflow "New workflow" {
resolves = ["PR label by Files"]
on = "pull_request"
}

action "PR label by Files" {
uses = "./"
secrets = ["GITHUB_TOKEN"]
}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
.idea
build
package-lock.json
coverage
junit.xml
60 changes: 60 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [Contributor Covenant Code of Conduct](#contributor-covenant-code-of-conduct)
- [Our Pledge](#our-pledge)
- [Our Standards](#our-standards)
- [Our Responsibilities](#our-responsibilities)
- [Scope](#scope)
- [Enforcement](#enforcement)
- [Attribution](#attribution)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [oss@decathlon.com](mailto:oss+githubactions@decathlon.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version]

[homepage]: https://contributor-covenant.org
[version]: https://contributor-covenant.org/version/1/4/
72 changes: 72 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Contributing

If you are on this page it means you are almost ready to contribute proposing changes, fixing issues or anything else.
So, **thanks for your time** !! :tada::+1:


<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [Contributing](#contributing)
- [Code of conduct](#code-of-conduct)
- [What are you talking about? Pull Request? Merge? Push?](#what-are-you-talking-about-pull-request-merge-push)
- [How Can I contribute?](#how-can-i-contribute)
- [Reporting Bug](#reporting-bug)
- [Code Contribution](#code-contribution)
- [Commit and Push on your branch](#commit-and-push-on-your-branch)
- [Pull Request guidelines](#pull-request-guidelines)
- [Contribution acceptance criteria](#contribution-acceptance-criteria)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Code of conduct
This project and everyone participating in it is governed by the [following code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.

## What are you talking about? Pull Request? Merge? Push?
If you are not familiar with Git and GitHub terms you can check a complete [glossary](https://help.github.com/articles/github-glossary/) on the GitHub website.

## How Can I contribute?

### Reporting Bug
The first way to contribute to a project is simply reporting a Bug. If you find anything which is not working well or as expected you can [open an issue](https://github.com/decathlon/slate-builder-action/issues) repository.

Before to open the issue please check if there is one similar already opened. It will save us hours of work and it will allow us to answer you quickly with the desired hotfix or implementation.

> **NOTE:** if looking for existing issues you will find the same problem, or similar, in **closed** state, please refer to this issue (with its number) when you are opening your one. It is maybe a regression we didn't see. In this way you will help to go faster and to find a definitive solution to the recurrent problem.
When you are opening an issue, please be sure to report as much information as you can to allow us to replicate the problem and faster find the solution.

### Code Contribution
If you are a dev and you want to directly fix a problem or implement a new feature... you are the best one ! :clap::clap:
To propose any change you have to submit us a [PullRequest](https://help.github.com/articles/about-pull-requests/)

The workflow we are using the one-pay project is:
1. Fork this repository (as you don't have a direct write access to the main one.
2. Create your code, `Commit` and `Push the code` on your forked repo
3. Create a GitHub `Pull Request` to our **master** branch (which is the main one for the coming version).

We will take the time to review your code, make some comments or asking information if needed. But, as you took time to help us, we will take in serious consideration what you are proposing.
To quickly have your code available on production, please take care and read our [Contribution acceptance criteria](#contribution-acceptance-criteria)

#### Commit and Push on your branch
```bash
git add <files>
git commit -m "A commit message"
git push origin <my-branch-name>
```

### Pull Request guidelines
When you open your pull request provide as much information as possible.
* For an issue, describe what you are fixing with your pull request and how you had found the defect.
* If you are proposing an enhancement, describe what you are adding to the code (new function, performance enhancement, documentation update, changing an existing function, ...).

### Contribution acceptance criteria
We love maintenable software and we are happy when some else than us is able to take the code, **understand it** and be able to change it.
To reach this goal we fixed some rule in our team and we would love to go ahead in this way, even with the external contribution:
1. Be sure your code compile: no syntax error, no missing library, ...
2. Add comments on the code if you want to explain better what is happening in the code.
3. Add documentation for any API, if needed, or functional explaining what changed/added with your code.
4. After you proposed the PullRequest. If you will receive any mail or find any automatic comment on the Pull Request you opened, it means there is something which is not respecting the project defined code style or your broke any previously created test.

If you respect all these rules you will help us saving time and we will be able to check your pull request faster.
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Stage 0: "install-stage", based on Node.js, to install dependencies
FROM node:lts-slim as install-stage

WORKDIR /app
# Copy the package.json
COPY package.json /app/
# Install node_modules
RUN npm install

# Stage 1: "build-stage" based on Node.js image, to build the compiled app (build folder)
FROM node:lts-slim as build-stage
WORKDIR /app
COPY --from=install-stage /app /app
COPY src /app/src
COPY tsconfig.json /app/tsconfig.json
# Run build
RUN npm run build:main

# Stage 2, based on NodeJs, to have only the compiled app, ready for production with Nginx
FROM node:lts-slim

# Labels for GitHub to read your action
LABEL "com.github.actions.name"="PR label by Files"
LABEL "com.github.actions.description"="Label a Pull Request based on pushed files "
# Here are all of the available icons: https://feathericons.com/
LABEL "com.github.actions.icon"="file-text"
# And all of the available colors: https://developer.github.com/actions/creating-github-actions/creating-a-docker-container/#label
LABEL "com.github.actions.color"="green"

COPY --from=build-stage /app /app
# Run `node /app/build/entrypoint.js`
ENTRYPOINT ["node", "/app/build/entrypoint.js"]

Loading

0 comments on commit 026bcfd

Please sign in to comment.