Skip to content

Commit

Permalink
feat: SJIP-644 github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
francisl committed Nov 20, 2023
1 parent 97ffdff commit 54d5095
Show file tree
Hide file tree
Showing 8 changed files with 231 additions and 16,575 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Build

on: [pull_request]

jobs:
build_qa:
name: Build QA Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set the QA configuration file
run: mv env-qa .env
- name: Ensure we can build the image
run: docker build -t test:test --target server .
15 changes: 15 additions & 0 deletions .github/workflows/commit_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Commit Lint Check

on: [push]

jobs:
build:
name: Commit Lint Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Lint Commits
uses: Ferlab-Ste-Justine/action-commit-lint@v2
36 changes: 36 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: 'Quality'

on:
pull_request:
branches:
- main

permissions:
actions: write
checks: write
contents: write
deployments: write
issues: write
packages: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write

jobs:
coverage:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: ArtiomTr/jest-coverage-report-action@v2
id: coverage
with:
test-script: npm run coverage:changed
output: report-markdown
- uses: marocchino/sticky-pull-request-comment@v2
with:
header: PR Coverage
message: ${{ steps.coverage.outputs.report }}
40 changes: 40 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 'Quality'

on:
pull_request:
branches:
- main

permissions:
actions: write
checks: write
contents: write
deployments: write
issues: write
packages: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install modules
run: npm i
- name: Run tests
id: tests
run: |
echo " " >> results.log
echo "## Project Coverage and Test" >> results.log
echo "" >> results.log
echo "`npm run test:github 2>&1 | sed 's/=//g' | tail -n 11`" >> results.log
echo " " >> results.log
- uses: marocchino/sticky-pull-request-comment@v2
with:
header: Project Coverage and Test
path: results.log
17 changes: 17 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
testEnvironment: 'jest-environment-jsdom',
moduleNameMapper: {
'^react-native$': 'react-native-web',
'^.+\\.module\\.(css|sass|scss)$': '<rootDir>/.jest/identity-obj-proxy-esm.js',
},
collectCoverageFrom: ['./src/**/*.{js,jsx,ts,tsx}'],
coverageReporters: ['json', 'lcov', 'text-summary', 'json-summary'],
coverageThreshold: {
global: {
branches: 0,
functions: 5,
lines: 15,
statements: 15,
},
},
};
Loading

0 comments on commit 54d5095

Please sign in to comment.