Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add single line #1137

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
196 changes: 109 additions & 87 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,36 @@ env:
node-version: '18.x'

jobs:
style-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: ${{ env.java-version }}
distribution: "corretto"
- uses: gradle/actions/setup-gradle@v4
with:
gradle-version: ${{ env.gradle-version }}
- name: Run Gradle Build
run: ./gradlew spotlessCheck
env:
OS_MIGRATIONS_GRADLE_SCAN_TOS_AGREE_AND_ENABLED: ''

python-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install flake8
- name: Analysing the code with flake8
run: |
flake8 $(git ls-files '*.py')
# style-check:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-java@v4
# with:
# java-version: ${{ env.java-version }}
# distribution: "corretto"
# - uses: gradle/actions/setup-gradle@v4
# with:
# gradle-version: ${{ env.gradle-version }}
# - name: Run Gradle Build
# run: ./gradlew spotlessCheck
# env:
# OS_MIGRATIONS_GRADLE_SCAN_TOS_AGREE_AND_ENABLED: ''
#
# python-lint:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: ${{ env.python-version }}
# - name: Install dependencies
# run: |
# python3 -m pip install --upgrade pip
# python3 -m pip install flake8
# - name: Analysing the code with flake8
# run: |
# flake8 $(git ls-files '*.py')

console-python-tests:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -112,8 +112,8 @@ jobs:
# if-no-files-found: error
# name: coverage-reports-gradle-tests
# path: /**/jacocoMergedReport.xml
#
#


# python-e2e-tests:
# runs-on: ubuntu-latest
# steps:
Expand Down Expand Up @@ -171,62 +171,84 @@ jobs:
# docker stop $(docker ps -q) && docker system prune --volumes -f
# docker image ls --format '{{.Repository}}:{{.Tag}}' | grep '^migrations/' | xargs -I {} docker image rm {}

node-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
npm-project:
- ./deployment/cdk/opensearch-service-migration
- ./deployment/migration-assistant-solution
defaults:
run:
working-directory: ${{ matrix.npm-project }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
- name: Install NPM dependencies
run: npm ci
- name: Run CDK Jest Tests (using mocked images)
run: npm run test

link-checker:
runs-on: ubuntu-latest
# node-tests:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# npm-project:
# - ./deployment/cdk/opensearch-service-migration
# - ./deployment/migration-assistant-solution
# defaults:
# run:
# working-directory: ${{ matrix.npm-project }}
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: ${{ env.node-version }}
# - name: Install NPM dependencies
# run: npm ci
# - name: Run CDK Jest Tests (using mocked images)
# run: npm run test
#
# link-checker:
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v4
# - name: lychee Link Checker
# id: lychee
# uses: lycheeverse/lychee-action@v1
# with:
# args: --verbose --accept=200,403,429 "**/*.html" "**/*.md" "**/*.txt" "**/*.json"
# --offline
# --exclude "file:///github/workspace/*"
# --exclude "http://localhost*"
# --exclude "https://localhost*"
# --exclude "http://capture-proxy*"
# --exclude "https://capture-proxy*"
# --exclude-mail
# fail: true
# env:
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

steps:
- uses: actions/checkout@v4
- name: lychee Link Checker
id: lychee
uses: lycheeverse/lychee-action@v1
with:
args: --verbose --accept=200,403,429 "**/*.html" "**/*.md" "**/*.txt" "**/*.json"
--offline
--exclude "file:///github/workspace/*"
--exclude "http://localhost*"
--exclude "https://localhost*"
--exclude "http://capture-proxy*"
--exclude "https://capture-proxy*"
--exclude-mail
fail: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
# upload-codecov:
# needs:
# - console-python-tests
## - gradle-tests
# if: success()
# runs-on: ubuntu-latest
# steps:
# - name: Download Coverage Artifacts
# uses: actions/download-artifact@v4
# with:
# pattern: coverage-reports-*
# path: ./coverage-reports
# - name: Upload Coverage
# uses: codecov/codecov-action@v4
# with:
# fail_ci_if_error: true
# files: ./coverage-reports/**/*.*
# flags: unittests
## token: ${{ secrets.CODECOV_TOKEN }}
# verbose: true

all-ci-checks-pass:
needs:
- console-python-tests
# all-ci-checks-pass:
# needs:
# - console-python-tests
# - gradle-tests
- link-checker
- node-tests
# - link-checker
# - node-tests
# - python-e2e-tests
- python-lint
- style-check
if: always()
runs-on: ubuntu-latest
steps:
- if: ${{ contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') }}
run: |
echo "One or more job cancelled, failed, or skipped" && exit 1
- run: |
echo '## :heavy_check_mark: All continous integration checks pass' >> $GITHUB_STEP_SUMMARY
# - python-lint
# - style-check
# if: always()
# runs-on: ubuntu-latest
# steps:
# - if: ${{ contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') }}
# run: |
# echo "One or more job cancelled, failed, or skipped" && exit 1
# - run: |
# echo '## :heavy_check_mark: All continous integration checks pass' >> $GITHUB_STEP_SUMMARY

18 changes: 18 additions & 0 deletions .github/workflows/codecov-publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Codecov Publish

# Due to the behavior of workflow_run, changes to this file will
# only be reflected once they are pushed up to the `default` (main) branch

on:
workflow_run:
workflows: [CI]
Expand All @@ -11,6 +14,15 @@ jobs:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: get PR
env:
GH_TOKEN: ${{ github.token }}
run: |
- echo "pull_request=$(gh api -H 'Accept:
application/vnd.github+json' -H 'X-Github-Api-Version: 2022-11-28' \
- /repos/${{ github.repository}}/actions/runs/${{ github.event.workflow_run.id }} | jq .pull_requests[0].number)" >> $GITHUB_ENV
- echo "Pull Request: $pull_request"

- name: Checkout Repository
uses: actions/checkout@v4

Expand All @@ -28,3 +40,9 @@ jobs:
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
# Manual overrides for these parameters are needed because automatic detection
# in codecov-action does not work for non-`pull_request` workflows.
# In `main` branch push, these default to empty strings since we want to run
# the analysis on HEAD.
override_commit: ${{ steps.parse_previous_artifacts.outputs.override_commit || '' }}
override_pr: ${{ steps.parse_previous_artifacts.outputs.override_pr || '' }}
Loading