diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index f6e1b0e..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: ci - -on: - push: - branches: - - main - - master - pull_request: - branches: - - main - - master - -jobs: - ci: - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [ubuntu-latest] - node: [14] - - steps: - - name: Checkout 🛎 - uses: actions/checkout@master - - - name: Setup node env 🏗 - uses: actions/setup-node@v2.4.0 - with: - node-version: ${{ matrix.node }} - check-latest: true - - - name: Get yarn cache directory path 🛠 - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - name: Cache node_modules 📦 - uses: actions/cache@v2.1.6 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Install dependencies 👨🏻‍💻 - run: yarn \ No newline at end of file diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index d796b28..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,75 +0,0 @@ - -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: - - develop - - master - pull_request: - branches: - - develop - - master - schedule: - - cron: '25 7 * * 5' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'javascript' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/gitguardian.yml b/.github/workflows/gitguardian.yml deleted file mode 100644 index 0f71d10..0000000 --- a/.github/workflows/gitguardian.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: "GitGuardian Scan" - -on: - push: - branches: - - develop - - master - -jobs: - scanning: - name: GitGuardian scan - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 # fetch all history so multiple commits can be scanned - - name: GitGuardian scan - uses: GitGuardian/gg-shield-action@master - env: - GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }} - GITHUB_PUSH_BASE_SHA: ${{ github.event.base }} - GITHUB_PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }} - GITHUB_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} - GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index ab6f846..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Lint - -on: - pull_request: - branches: - - develop - - master - -jobs: - run-lint: - name: Run linters - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-node@v2.4.0 - with: - node-version: 14 - - - name: Install Node.js dependencies - run: yarn install - - - name: Run linters - run: yarn run lint \ No newline at end of file diff --git a/.github/workflows/push-tag-version.yml b/.github/workflows/push-tag-version.yml deleted file mode 100644 index 35deeca..0000000 --- a/.github/workflows/push-tag-version.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Bump version Git -on: - push: - branches: - - develop - - master -jobs: - run-lint: - name: Run linters - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2.4.0 - with: - node-version: 14 - - name: Install Node.js dependencies - run: yarn install - - name: Run linters - run: yarn run lint - - build: - needs: [run-lint] - name: Build a docker image - runs-on: ubuntu-latest - outputs: - tag_version: '${{ steps.tagging.outputs.new_version }}' - steps: - - uses: actions/checkout@v3 - - id: tagging - name: Bump version and push tag - uses: mathieudutour/github-tag-action@v6.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - release_branches: master - pre_release_branches: develop - default_bump: patch - fetch_all_tags: true - tag_prefix: 'tag-' - # - name: Create a GitHub Tag version - # uses: ncipollo/release-action@v1 - # with: - # tag: ${{ steps.tag_version.outputs.new_tag }} - # name: Release ${{ steps.tag_version.outputs.new_tag }} - # body: ${{ steps.tag_version.outputs.changelog }} - - - diff --git a/.github/workflows/sonar-analysis.yml b/.github/workflows/sonar-analysis.yml deleted file mode 100644 index e7b0494..0000000 --- a/.github/workflows/sonar-analysis.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Run Sonar cloud analysis - -on: - push: - branches: - - master - - develop - -jobs: - sonar-analysis: - name: Run test coverage and sonar analysis - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - with: - # Disabling shallow clone is recommended for improving relevancy of reporting - fetch-depth: 0 - - - name: SonarCloud Scan - uses: sonarsource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.SONAR_GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/test-e2e-req-input.yml b/.github/workflows/test-e2e-req-input.yml new file mode 100644 index 0000000..65910f0 --- /dev/null +++ b/.github/workflows/test-e2e-req-input.yml @@ -0,0 +1,37 @@ +name: Run Test E2E Required Input +on: + workflow_dispatch: + inputs: + version-tag: + description: 'Version tag or branch to test' + required: true + default: 'master' + +jobs: + test-e2e: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository Test E2E + uses: actions/checkout@v3 + with: + repository: NitichaiSawangsai/cypress-ex1 + ref: ${{ github.event.inputs.version-tag }} + token: ${{ secrets.REPO_CYPRESS_EX1_ACCESS_TOKEN }} + + - name: Install dependencies + run: npm install + + - name: Cypress run + uses: cypress-io/github-action@v5 + + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: cypress-screenshots + path: cypress/screenshots + + - uses: actions/upload-artifact@v3 + if: always() + with: + name: cypress-videos + path: cypress/videos diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 28787e6..580f1ee 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -1,8 +1,10 @@ -name: End-to-end test - +name: Run Test E2E on: - push: - branches: + # push: + # branches: + # - release + pull_request: + branches: - release jobs: test-e2e: @@ -10,18 +12,15 @@ jobs: steps: # action clones the repository into this environment, # making your code available for the workflow steps that follow. - - name: Checkout Repository B + - name: Checkout Repository Test E2E uses: actions/checkout@v3 with: repository: NitichaiSawangsai/cypress-ex1 # เปลี่ยนเป็น repository ของคุณ - ref: release # ตรวจสอบจาก branch release - token: ${{ github.token }} # ใช้ Personal Access Token ที่มีสิทธิ์ในการอ่าน Repository secrets.REPO_CYPRESS_EX1_ACCESS_TOKEN - - - name: Install Dependencies - run: npm install # ติดตั้ง dependencies ของ Cypress + ref: master # ตรวจสอบจาก branch release + token: ${{ github.token }} # ใช้ Personal Access Token ที่มีสิทธิ์ในการอ่าน Repository REPO_CYPRESS_EX1_ACCESS_TOKEN - - name: Run E2E Tests with Cypress - run: npm run cy:run # แก้ตามคำสั่งที่ใช้ใน Repository B สำหรับรัน Cypress tests + - name: Install dependencies + run: npm install # Install NPM dependencies, cache them correctly # and run all Cypress tests