generated from RedHatInsights/frontend-starter-app
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1072 from RedHatInsights/release_prod-stable.77046
Deployment commit for prod-stable
- Loading branch information
Showing
8 changed files
with
437 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: [ main, prod-beta, prod-stable, stage-beta, stage-stable ] | ||
push: | ||
branches: [ main, prod-beta, prod-stable, stage-beta, stage-stable ] | ||
|
||
env: | ||
BRANCH: ${{ github.base_ref }} | ||
NODEJS_VERSION: '18' | ||
|
||
jobs: | ||
build: | ||
# This job is run for PRs only, as a sanity check, to confirm ci.ext.devshift.net is working properly | ||
if: ${{ github.event_name == 'pull_request' }} | ||
name: Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODEJS_VERSION }} | ||
|
||
- name: Cache node modules | ||
id: cache-npm | ||
uses: actions/cache@v4 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Lint | ||
run: npm run lint | ||
|
||
units: | ||
name: Units | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODEJS_VERSION }} | ||
|
||
- name: Cache node modules | ||
id: cache-npm | ||
uses: actions/cache@v4 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Test | ||
id: test_run | ||
run: npm test -- --collect-coverage --max-workers=4 | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: ${{ steps.test_run.outcome == 'success' }} | ||
name: Save coverage report | ||
with: | ||
name: coverage_report | ||
path: coverage/ | ||
retention-days: 10 | ||
|
||
coverage: | ||
name: Coverage | ||
needs: [units] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download coverage report | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: coverage_report | ||
path: coverage | ||
|
||
- name: Upload coverage report | ||
if: ${{ success() }} | ||
uses: codecov/[email protected] | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
with: | ||
directory: coverage | ||
plugin: pycoverage # Only run one plugin so that all do not run. There is no way to disable plugins entirely. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Tag Release | ||
on: | ||
push: | ||
branches: | ||
- prod-stable | ||
jobs: | ||
tag_release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: prod-stable | ||
- run: | | ||
git fetch --prune --unshallow | ||
- name: Tag this release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
DATE=$(date +"%Y.%m.%d") | ||
PREV_RELEASE=$(git tag --list | tail -1) | ||
MINOR_VERSION=0 | ||
case $PREV_RELEASE in | ||
*"$DATE"*) | ||
MINOR_VERSION="$PREV_RELEASE" | cut -d'.' -f5 | ||
MINOR_VERSION=$((MINOR_VERSION+1)) | ||
;; | ||
*) | ||
MINOR_VERSION=0 | ||
;; | ||
esac | ||
TAG="r.$DATE.$MINOR_VERSION" | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Hybrid Committed Spend Release Action" | ||
git log $(git tag --list | tail -1)..prod-stable | git tag -a $TAG -F - | ||
git push origin $TAG | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.