Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.

Commit 9b3a905

Browse files
chore(CI): Migrate from Travis to GH actions (#554)
1 parent ce93166 commit 9b3a905

7 files changed

Lines changed: 454 additions & 21 deletions

File tree

.github/workflows/test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Test runner
2+
on:
3+
push:
4+
branches: ['master']
5+
pull_request:
6+
branches: ['master']
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
- run: yarn install
15+
- run: npm run lint
16+
- name: Validate current commit (last commit) with commitlint
17+
if: github.event_name == 'push'
18+
run: npx commitlint --last --verbose
19+
- name: Validate PR commits with commitlint
20+
if: github.event_name == 'pull_request'
21+
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
22+
- run: npm run ci:verify
23+
- name: Upload code coverage
24+
uses: codecov/codecov-action@v5.3.1
25+
with:
26+
fail_ci_if_error: true
27+
files: ./coverage/coverage-final.json
28+
token: ${{ secrets.CODECOV_TOKEN }}
29+
- run: npm run build

.travis.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/RedHatInsights/policies-ui-frontend.svg?branch=master)](https://travis-ci.com/RedHatInsights/policies-ui-frontend)
1+
[![Build Status](https://img.shields.io/github/actions/workflow/status/RedhatInsights/policies-ui-frontend/test.yml?branch=master)](https://github.com/RedHatInsights/policies-ui-frontend/actions/workflows/test.yml)
22

33
# policies-ui-frontend
44
Policies frontend for Red Hat Insights

commitlint.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'subject-case': [0, 'always'],
5+
'footer-max-length': [0, 'always'],
6+
'footer-max-line-length': [0, 'always'],
7+
'body-max-length': [0, 'always'],
8+
'body-max-line-length': [0, 'always'],
9+
},
10+
};

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module.exports = {
22
preset: 'ts-jest',
33
testEnvironment: 'jsdom',
4+
collectCoverage: true,
45
coverageDirectory: './coverage',
56
collectCoverageFrom: [
67
'src/**/*.{ts,tsx}',

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"version": "1.1.0",
44
"private": false,
55
"dependencies": {
6+
"@commitlint/cli": "^19.8.0",
7+
"@commitlint/config-conventional": "^19.8.0",
68
"@patternfly/patternfly": "^5.4.0",
79
"@patternfly/react-component-groups": "^5.2.0",
810
"@patternfly/react-core": "^5.4.0",
@@ -116,7 +118,6 @@
116118
"build": "fec build",
117119
"build:prod": "fec build",
118120
"ci:test": "yarn test --coverage --forceExit --maxWorkers=4 --detectOpenHandles && curl -s https://codecov.io/bash | bash",
119-
"ci:schema": "bash ./.travis/schema-check.sh",
120121
"test": "TZ=UTC jest --verbose --no-cache",
121122
"smoketest": "karma start ./config/karma.conf.ts",
122123
"lint": "npm-run-all lint:*",
@@ -126,8 +127,8 @@
126127
"server:ctr": "node src/server/generateServerKey.js",
127128
"start": "fec dev",
128129
"start:proxy": "PROXY=true fec dev",
129-
"travis": "npm-run-all build:prod lint 'test --coverage --forceExit --maxWorkers=4 --detectOpenHandles' smoketest",
130130
"verify": "npm-run-all build lint test",
131+
"ci:verify": "npm run test",
131132
"nightly": "npm run deploy",
132133
"schema": "npm-run-all schema:policies",
133134
"schema:policies": "npm-run-all 'schema:policies:generate -i http://localhost:8080/api/policies/v1.0/openapi.json'",

0 commit comments

Comments
 (0)