Skip to content

Commit

Permalink
fix(deps): update minors and use github-actions (#147)
Browse files Browse the repository at this point in the history
* chore(deps): update all non-major dev dependencies

* chore: add workflows

* chore: release

* fix: demo

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Julien Bouquillon <julien.bouquillon@sg.social.gouv.fr>
  • Loading branch information
3 people authored Sep 22, 2021
1 parent 83446a6 commit 9c7e48d
Show file tree
Hide file tree
Showing 9 changed files with 2,670 additions and 1,968 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: "22 3 * * 4"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ["javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
28 changes: 28 additions & 0 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Demo

on:
push:
tags:
- v*

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Node setup
uses: actions/setup-node@v2
with:
node-version: "14"

- name: Yarn cache setup
uses: c-hive/gha-yarn-cache@v1

- name: Install dependencies
run: yarn --frozen-lockfile --prefer-offline

- name: Build demo
run: yarn build:demo
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
workflow_dispatch:
push:
branches: [master, alpha, beta, next]

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Yarn cache setup
uses: c-hive/gha-yarn-cache@v1

- name: Install dependencies
run: yarn --frozen-lockfile --prefer-offline

- name: Run tests
run: yarn lint

- name: Run tests
run: yarn test --coverage

- name: Build
run: yarn build

- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@v2
with:
semantic_version: 17
extra_plugins: |
@semantic-release/changelog@5.0.1
@semantic-release/git@9.0.0
env:
GIT_AUTHOR_EMAIL: ${{ secrets.SOCIALGROOVYBOT_EMAIL }}
GIT_AUTHOR_NAME: ${{ secrets.SOCIALGROOVYBOT_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.SOCIALGROOVYBOT_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.SOCIALGROOVYBOT_NAME }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.SOCIALGROOVYBOT_NPM_TOKEN }}
16 changes: 8 additions & 8 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ on:
pull_request: {}
push:
branches:
- main
- master
- main
- master
name: Semgrep
jobs:
semgrep:
name: Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: returntocorp/semgrep-action@v1
with:
auditOn: push
publishToken: ${{ secrets.SEMGREP_APP_TOKEN }}
publishDeployment: 1398
- uses: actions/checkout@v2
- uses: returntocorp/semgrep-action@v1
with:
auditOn: push
publishToken: ${{ secrets.SEMGREP_APP_TOKEN }}
publishDeployment: 1398
38 changes: 38 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Tests

on:
pull_request:
branches:
- "**"

concurrency:
cancel-in-progress: true
group: ${{ github.head_ref }}

jobs:
##############################################################################
## TEST APPLICATION
##############################################################################
test:
name: Test application
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Node setup
uses: actions/setup-node@v2
with:
node-version: "14"

- name: Yarn cache setup
uses: c-hive/gha-yarn-cache@v1

- name: Install dependencies
run: yarn --frozen-lockfile --prefer-offline

- name: Run tests
run: yarn lint

- name: Run tests
run: yarn test --coverage
64 changes: 0 additions & 64 deletions .gitlab-ci.yml

This file was deleted.

68 changes: 0 additions & 68 deletions .travis.yml

This file was deleted.

32 changes: 17 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"module": "esm/index.js",
"browser": "dist/index.js",
"license": "Apache-2.0",
"publishConfig": {
"access": "public"
},
"files": [
"README.md",
"cjs",
Expand All @@ -17,21 +20,21 @@
"react-svgmt": "^1.1.11"
},
"devDependencies": {
"@babel/cli": "^7.11.6",
"@babel/core": "^7.11.6",
"@babel/preset-env": "^7.11.5",
"@babel/preset-react": "^7.10.4",
"@socialgouv/eslint-config-react": "^0.22.1",
"babel-jest": "^26.3.0",
"eslint": "^7.9.0",
"gh-pages": "^3.1.0",
"jest": "^26.4.2",
"parcel-bundler": "^1.12",
"@babel/cli": "^7.15.7",
"@babel/core": "^7.15.5",
"@babel/preset-env": "^7.15.6",
"@babel/preset-react": "^7.14.5",
"@socialgouv/eslint-config-react": "^0.35.0",
"babel-jest": "^26.6.3",
"eslint": "^7.32.0",
"gh-pages": "^3.2.3",
"jest": "^26.6.3",
"parcel-bundler": "1.12.3",
"prettier": "^1.19.1",
"prop-types": "^15.7.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-test-renderer": "^16.13.1"
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-test-renderer": "^16.14.0"
},
"peerDependencies": {
"prop-types": "15.x",
Expand All @@ -48,7 +51,6 @@
"build:browser": "parcel build ./src/index.js --global minimum-parcel-lib",
"build:cjs": "BABEL_ENV=cjs babel src --out-dir cjs",
"build:demo": "parcel build ./example/src/index.html --out-dir ./example/dist --public-url ./",
"build:esm": "BABEL_ENV=esm babel src --out-dir esm",
"deploy": "gh-pages -d ./example/dist -r https://gitlab-ci-token:$GH_TOKEN@github.com/SocialGouv/react-departements.git"
"build:esm": "BABEL_ENV=esm babel src --out-dir esm"
}
}
Loading

0 comments on commit 9c7e48d

Please sign in to comment.