-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DEVOPS-248] Migrate CircleCI to Github actions (#1313)
* Migrating from CircleCI to GitHub Actions * Update env variable to use secrets * Revert "Update env variable to use secrets" This reverts commit 40de4af. * Fixed typo * Removed e2e release branch logic in nightwatch workflow * Adding push event to create workflow dispatch * Updated branch to main for reusable workflows * Added runner inputs to use ubuntu-latest * Added missing closed bracket * Revert "Adding push event to create workflow dispatch" This reverts commit e1c0615. * Temporary disabled workflows by updating the trigger event to branches that do not exist --------- Co-authored-by: Tim Yao <31641325+tim-yao@users.noreply.github.com>
- Loading branch information
1 parent
803a43c
commit 0ee3c05
Showing
9 changed files
with
310 additions
and
0 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,24 @@ | ||
name: dpc-sdp/ripple/build | ||
on: | ||
workflow_call: | ||
env: | ||
CONTENT_API_SERVER: ${{ vars.CONTENT_API_SERVER }} | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3.5.0 | ||
- uses: actions/setup-node@v3.6.0 | ||
with: | ||
node-version: '14' | ||
- name: Restore cache | ||
uses: actions/cache@v3.3.1 | ||
with: | ||
key: v10-deps-${{ hashFiles('yarn.lock') }} | ||
path: | | ||
./.cache | ||
**/node_modules | ||
- name: Install Dependencies | ||
run: yarn install --frozen-lockfile --cache-folder .cache/yarn | ||
- name: Build reference nuxt app | ||
run: yarn reference:build |
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,26 @@ | ||
name: dpc-sdp/ripple/canary-npm-release | ||
on: | ||
push: | ||
branches: | ||
# Uncomment below once testing has been completed and we are ready to publish using this workflow | ||
#- uat | ||
- 'github-action/disable-workflow' | ||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yml | ||
test: | ||
needs: | ||
- build | ||
uses: ./.github/workflows/test.yml | ||
create-prerelease: | ||
needs: | ||
- test | ||
uses: ./.github/workflows/create-release.yml | ||
with: | ||
canary-prerelease: true | ||
tag-release: | ||
needs: | ||
- create-prerelease | ||
permissions: | ||
contents: write | ||
uses: ./.github/workflows/tag-release.yml |
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,35 @@ | ||
name: dpc-sdp/ripple/commit | ||
on: | ||
workflow_call: | ||
push: | ||
branches-ignore: | ||
- master | ||
env: | ||
CHROMATIC_APP_CODE: ${{ secrets.CHROMATIC_APP_CODE }} | ||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yml | ||
test: | ||
needs: | ||
- build | ||
uses: ./.github/workflows/test.yml | ||
storybook: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
steps: | ||
- uses: actions/checkout@v3.5.0 | ||
with: | ||
fetch-depth: 0 # 👈 Required to retrieve git history | ||
- uses: actions/setup-node@v3.6.0 | ||
with: | ||
node-version: '14' | ||
- name: Restore cache | ||
uses: actions/cache@v3.3.1 | ||
with: | ||
key: v10-deps-${{ hashFiles('yarn.lock') }} | ||
path: | | ||
./.cache | ||
**/node_modules | ||
- name: Run UI test | ||
run: cd src && yarn chromatic --project-token $CHROMATIC_APP_CODE --exit-zero-on-changes |
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,29 @@ | ||
name: dpc-sdp/ripple/create-release | ||
on: | ||
workflow_call: | ||
inputs: | ||
canary-prerelease: | ||
type: boolean | ||
default: false | ||
jobs: | ||
create-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3.5.0 | ||
- name: Restore cache | ||
uses: actions/cache@v3.3.1 | ||
with: | ||
key: v10-deps-${{ hashFiles('yarn.lock') }} | ||
path: | | ||
./.cache | ||
**/node_modules | ||
- name: Authenticate with registry | ||
run: |- | ||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc | ||
git update-index --assume-unchanged .npmrc | ||
- name: Publish pre-release packages to NPM | ||
if: inputs.canary-prerelease == true | ||
run: npx lerna publish from-package --canary --force-publish --no-push --dist-tag dev --yes --no-verify-access | ||
- name: Publish packages to NPM | ||
if: inputs.canary-prerelease == false | ||
run: npx lerna publish from-package --force-publish --yes --no-verify-access |
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,72 @@ | ||
name: dpc-sdp/ripple/nightwatch | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
e2e: | ||
type: boolean | ||
required: true | ||
e2e_project: | ||
type: string | ||
required: true | ||
e2e_be_url: | ||
type: string | ||
e2e_fe_url: | ||
type: string | ||
jobs: | ||
e2e_be: | ||
if: inputs.e2e | ||
uses: dpc-sdp/github-actions/.github/workflows/run_e2e_be.yml@main | ||
secrets: inherit | ||
with: | ||
tags: "(@core or @${{ inputs.e2e_project }}) and @regression" | ||
be_url: ${{ inputs.e2e_be_url }} | ||
project: ${{ inputs.e2e_project }} | ||
browser: 'chrome' | ||
test_id: 'fixture' | ||
test_type: ':nightwatch:' | ||
runner: 'ubuntu-latest' | ||
e2e_fe_smoke: | ||
if: inputs.e2e | ||
uses: dpc-sdp/github-actions/.github/workflows/run_e2e_fe.yml@main | ||
secrets: inherit | ||
with: | ||
tags: "(@smoke and @core) or (@smoke and @${{ inputs.e2e_project }})" | ||
be_url: ${{ inputs.e2e_be_url }} | ||
fe_url: ${{ inputs.e2e_fe_url }} | ||
project: ${{ inputs.e2e_project }} | ||
browser: 'chrome' | ||
test_id: 'fixture' | ||
test_type: ':nightwatch:' | ||
runner: 'ubuntu-latest' | ||
e2e_fe_chrome: | ||
needs: | ||
- e2e_be | ||
- e2e_fe_smoke | ||
if: inputs.e2e | ||
uses: dpc-sdp/github-actions/.github/workflows/run_e2e_fe.yml@main | ||
secrets: inherit | ||
with: | ||
tags: "(@core or @${{ inputs.e2e_project }}) and @regression and not @mobile" | ||
be_url: ${{ inputs.e2e_be_url }} | ||
fe_url: ${{ inputs.e2e_fe_url }} | ||
project: ${{ inputs.e2e_project }} | ||
browser: 'chrome' | ||
test_id: 'fixture' | ||
test_type: ':nightwatch:' | ||
runner: 'ubuntu-latest' | ||
e2e_fe_android: | ||
needs: | ||
- e2e_be | ||
- e2e_fe_smoke | ||
if: inputs.e2e | ||
uses: dpc-sdp/github-actions/.github/workflows/run_e2e_fe.yml@main | ||
secrets: inherit | ||
with: | ||
tags: "(@core or @${{ inputs.e2e_project }}) and @regression and not @desktop" | ||
be_url: ${{ inputs.e2e_be_url }} | ||
fe_url: ${{ inputs.e2e_fe_url }} | ||
project: ${{ inputs.e2e_project }} | ||
browser: 'androidChrome' | ||
test_id: 'fixture' | ||
test_type: ':nightwatch:' | ||
runner: 'ubuntu-latest' |
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,53 @@ | ||
name: dpc-sdp/ripple/publish-to-npm | ||
on: | ||
push: | ||
branches: | ||
# Uncomment below once testing has been completed and we are ready to publish using this workflow | ||
#- master | ||
- 'github-action/disable-workflow' | ||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yml | ||
test: | ||
needs: | ||
- build | ||
uses: ./.github/workflows/test.yml | ||
confirm-release: | ||
environment: | ||
name: approval | ||
runs-on: ubuntu-latest | ||
needs: | ||
- test | ||
steps: | ||
- run: echo 'approved' | ||
create-release: | ||
needs: | ||
- confirm-release | ||
uses: ./.github/workflows/create-release.yml | ||
tag-release: | ||
needs: | ||
- create-release | ||
permissions: | ||
contents: write | ||
uses: ./.github/workflows/tag-release.yml | ||
create-release-notes: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- tag-release | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v3.5.0 | ||
- name: Restore cache | ||
uses: actions/cache@v3.3.1 | ||
with: | ||
key: v10-deps-${{ hashFiles('yarn.lock') }} | ||
path: | | ||
./.cache | ||
**/node_modules | ||
- name: Install github-release-notes package | ||
run: yarn add -D -W github-release-notes | ||
- name: Generate release notes and publish to GitHub | ||
run: |- | ||
PACKAGE_VERSION=$(node -pe "require('./lerna.json')['version']") | ||
npx gren release --data-source=commits --tags=v$PACKAGE_VERSION --override --token ${{ secrets.GITHUB_TOKEN }} |
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,19 @@ | ||
name: dpc-sdp/ripple/tag-release | ||
on: | ||
workflow_call: | ||
jobs: | ||
tag-release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v3.5.0 | ||
- name: Git tag the release with the `lerna.json` version number | ||
run: |- | ||
PACKAGE_VERSION=$(node -pe "require('./lerna.json')['version']") | ||
git tag v$PACKAGE_VERSION | ||
- name: Push git tag to the remote repository | ||
run: |- | ||
PACKAGE_VERSION=$(node -pe "require('./lerna.json')['version']") | ||
echo $PACKAGE_VERSION | ||
git push -q https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git v$PACKAGE_VERSION |
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,34 @@ | ||
name: dpc-sdp/ripple/test | ||
on: | ||
workflow_call: | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3.5.0 | ||
- uses: actions/setup-node@v3.6.0 | ||
with: | ||
node-version: '14' | ||
- name: Restore cache | ||
uses: actions/cache@v3.3.1 | ||
with: | ||
key: v10-deps-${{ hashFiles('yarn.lock') }} | ||
path: | | ||
./.cache | ||
**/node_modules | ||
- name: Lint code. | ||
run: yarn lint --format ./node_modules/eslint-junit/index.js | ||
env: | ||
ESLINT_JUNIT_OUTPUT: "./test-results/lint/eslint.xml" | ||
- name: Unit tests | ||
run: yarn test:unit --ci --runInBand --reporters=default --reporters=jest-junit | ||
env: | ||
JEST_JUNIT_OUTPUT_DIR: test-results/unit/ | ||
- name: Upload test results | ||
uses: actions/upload-artifact@v3.1.1 | ||
with: | ||
name: Test results | ||
path: | | ||
test-results | ||
examples/reference/test/integration/videos | ||
examples/reference/test/integration/screenshots |
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