Skip to content

Commit

Permalink
chore: review github ci files
Browse files Browse the repository at this point in the history
  • Loading branch information
rodcordeiro committed Nov 19, 2023
1 parent eb20f13 commit 0b7f0f4
Show file tree
Hide file tree
Showing 8 changed files with 209 additions and 6 deletions.
30 changes: 30 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
# Maintain dependencies for npm packages
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
target-branch: "develop"
allow:
- dependency-type: "production"
assignees:
- "rodcordeiro"
labels:
- "dependencies"

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "develop"
schedule:
interval: "weekly"
allow:
- dependency-type: "all"
labels:
- "dependencies"
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Description

What is this pull request for? Add a little description about what was done and why. Add images or gists if needed.

# Type of PR
- [ ] Bugfix
- [ ] New feature
- [ ] Documentation

# Changes made
What have you added/removed to the code.
49 changes: 49 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"branchPrefix": "updates/",
"baseBranches": [
"main"
],
"packageRules": [
{
"updateTypes": [
"minor",
"patch",
"pin",
"digest"
],
"automerge": true
},
{
"updateTypes": [
"major"
],
"automerge": false
}
],
"assignAutomerge": true,
"assignees": [
"rodcordeiro"
],
"labels": [
"dependencies"
],
"recreateClosed": true,
"rebaseWhen": "conflicted",
"vulnerabilityAlerts": {
"labels": [
"security"
],
"assignees": [
"@rodcordeiro"
]
},
"extends": [
"config:base",
":dependencyDashboard",
"github>whitesource/merge-confidence:beta"
],
"schedule": [
"before 3am on the first day of the month"
],
"timezone": "America/Sao_Paulo"
}
39 changes: 39 additions & 0 deletions .github/workflows/CodeAnalysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Scan code quality"

on:
push:
branches: ["main", "feat/**", "bug/**", "develop"]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: "0 3 * * 1"

jobs:
CodeQuality:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ["javascript"]

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
34 changes: 34 additions & 0 deletions .github/workflows/PublishUpdates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Expo actions
on:
push:
branches:
- main
jobs:
ValidateActor:
runs-on: ubuntu-latest
outputs:
ACTOR: ${{ steps.actor.outputs.ACTOR }}
steps:
- id: actor
run: |
if [[ ${{ github.actor }} != *"[bot]" ]];then
echo "::set-output name=ACTOR::true"
else
echo "::set-output name=ACTOR::false"
fi
GenerateNewBuild:
name: Build new artifact
runs-on: ubuntu-latest
needs: Publish_Updates
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18.x
- uses: expo/expo-github-action@v8
with:
eas-version: latest
eas-cache: true
token: ${{ secrets.EXPO_TOKEN }}
- run: npm install
- run: eas build -p android --profile production --non-interactive
32 changes: 32 additions & 0 deletions .github/workflows/Validate_build_on_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Validate build and publish preview"

on:
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4

- name: 🏗 Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: yarn

- name: 🏗 Setup Expo
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}

- name: 📦 Install dependencies
run: yarn install

- name: Create preview
uses: expo/expo-github-action/preview@v8
with:
command: eas update --auto
14 changes: 14 additions & 0 deletions .github/workflows/ValidatesBranchNaming.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 'Assert Branch Naming Convention'
on: [push, pull_request]

jobs:
branch-naming-rules:
runs-on: ubuntu-latest
steps:
- uses: deepakputhraya/action-branch-name@master
with:
regex: '([\w]{3,})+\/([\w(?:\-,.,_)]{5,})' # Regex the branch should match. This example enforces grouping
allowed_prefixes: 'feature,stable,fix,updates' # All branches should start with the given prefix
ignore: main,develop # Ignore exactly matching branch names from convention
min_length: 5 # Min length of the branch name
max_length: 50 # Max length of the branch name
6 changes: 0 additions & 6 deletions renovate.json

This file was deleted.

0 comments on commit 0b7f0f4

Please sign in to comment.