Skip to content

Commit

Permalink
ci: upgrade actions & config (#71)
Browse files Browse the repository at this point in the history
* ci: fix docker

* fix: docker error

* fix: docker

* fix: node version

* fix: linter

* fix

* fix lint

* update

* update

* refactor: move to new starter

* add vitest

* remove

* fix unit

* test

* fix style

* update

* remove unuse

* update

* update

* fix

* update

* update

* update

* fix e2e

* update

* fix

* fix

* fix

* fix

* update

* fix

* fix

* test

* test

* fix

* fix
  • Loading branch information
sky172839465 authored Nov 17, 2024
1 parent 1d69c2e commit c713d00
Show file tree
Hide file tree
Showing 66 changed files with 18,571 additions and 25,829 deletions.
48 changes: 0 additions & 48 deletions .eslintrc.js

This file was deleted.

136 changes: 68 additions & 68 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,70 +67,70 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: unit-test-output
path: ./reports

functional_test:
needs: [deploy_flyio]
name: Functional test
runs-on: ubuntu-latest
env:
SAUCE_USERNAME: sky172839465
SAUCE_ACCESS_KEY: ${{secrets.SAUCE_ACCESS_KEY}}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"

- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
run: npm ci

- name: Run functional test on saucelabs
env:
TEST_URL: ${{needs.deploy_flyio.outputs.TEST_URL}}
run: |
echo TEST_URL=$TEST_URL
npm run ci-functional
- name: Generate functional test allure report
run: npm run functional:generate-report

- uses: actions/upload-artifact@v4
with:
name: functional-test-output
path: ./output

- name: Get report info
if: ${{ always() }}
uses: actions/github-script@v7
with:
script: |
const { getGHPageInfo } = require('./scripts/ghpage-helper')
const info = await getGHPageInfo({ context })
core.exportVariable('E2E_REPORT_DIR', `./${info.destination_dir}`)
- name: Upload report to GitHub page
if: ${{ always() }}
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./e2e-reports
destination_dir: ${{ env.E2E_REPORT_DIR }}
commit_message: "docs: 🤖 upload pr report ${{ github.event.head_commit.message }}"
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
path: ./reporters

# functional_test:
# needs: [deploy_flyio]
# name: Functional test
# runs-on: ubuntu-latest
# env:
# SAUCE_USERNAME: sky172839465
# SAUCE_ACCESS_KEY: ${{secrets.SAUCE_ACCESS_KEY}}
# steps:
# - uses: actions/checkout@v4

# - uses: actions/setup-java@v4
# with:
# distribution: "temurin"
# java-version: "17"

# - name: Cache node_modules
# id: cache-node-modules
# uses: actions/cache@v4
# with:
# path: node_modules
# key: node-modules-${{ hashFiles('package-lock.json') }}

# - name: Install dependencies
# run: npm ci

# - name: Run functional test on saucelabs
# env:
# TEST_URL: ${{needs.deploy_flyio.outputs.TEST_URL}}
# run: |
# echo TEST_URL=$TEST_URL
# npm run ci-functional

# - name: Generate functional test allure report
# run: npm run functional:generate-report

# - uses: actions/upload-artifact@v4
# with:
# name: functional-test-output
# path: ./output

# - name: Get report info
# if: ${{ always() }}
# uses: actions/github-script@v7
# with:
# script: |
# const { getGHPageInfo } = require('./scripts/ghpage-helper')
# const info = await getGHPageInfo({ context })
# core.exportVariable('E2E_REPORT_DIR', `./${info.destination_dir}`)

# - name: Upload report to GitHub page
# if: ${{ always() }}
# uses: peaceiris/actions-gh-pages@v4
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./e2e-reports
# destination_dir: ${{ env.E2E_REPORT_DIR }}
# commit_message: "docs: 🤖 upload pr report ${{ github.event.head_commit.message }}"
# user_name: "github-actions[bot]"
# user_email: "github-actions[bot]@users.noreply.github.com"

clean_up:
needs: [deploy_flyio, static_and_unit_test, functional_test]
needs: [deploy_flyio, static_and_unit_test]
name: Clean up
runs-on: ubuntu-latest
steps:
Expand All @@ -155,17 +155,17 @@ jobs:
name: unit-test-output
path: ./reports

- uses: actions/download-artifact@v4
with:
name: functional-test-output
path: ./output
# - uses: actions/download-artifact@v4
# with:
# name: functional-test-output
# path: ./output

- name: Get report info
if: ${{ always() }}
uses: actions/github-script@v7
with:
script: |
const { getGHPageInfo } = require('./scripts/ghpage-helper')
const { getGHPageInfo } = require('./scripts/ghpage-helper.cjs')
const info = await getGHPageInfo({ context })
console.log(info)
core.exportVariable('GH_PAGE_URL', info.ghPage)
Expand All @@ -182,7 +182,7 @@ jobs:
DATE: ${{ steps.get-date.outputs.DATE }}
with:
script: |
const getComment = require('./scripts/get-comment')
const getComment = require('./scripts/get-comment.cjs')
const comment = await getComment({ context })
console.log(comment)
core.exportVariable('BUILD_COMMENT', comment)
Expand Down
118 changes: 59 additions & 59 deletions .github/workflows/schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,58 +54,58 @@ jobs:
name: unit-test-output
path: ./reports

functional_test:
name: Functional test
runs-on: ubuntu-latest
env:
SAUCE_USERNAME: sky172839465
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"

- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
run: npm ci

- name: Run functional test on saucelabs
env:
TEST_URL: ${{ env.TEST_URL }}
run: |
echo TEST_URL=$TEST_URL
npm run ci-functional
- name: Generate functional test allure report
run: npm run functional:generate-report

- uses: actions/upload-artifact@v4
with:
name: functional-test-output
path: ./output

- name: Upload report to GitHub page
if: ${{ always() }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./e2e-reports
destination_dir: ${{ github.run_id }}
commit_message: "docs: 🤖 upload schedule report ${{ github.run_id }}"
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
# functional_test:
# name: Functional test
# runs-on: ubuntu-latest
# env:
# SAUCE_USERNAME: sky172839465
# SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
# steps:
# - uses: actions/checkout@v4

# - uses: actions/setup-java@v4
# with:
# distribution: "temurin"
# java-version: "17"

# - name: Cache node_modules
# id: cache-node-modules
# uses: actions/cache@v4
# with:
# path: node_modules
# key: node-modules-${{ hashFiles('package-lock.json') }}

# - name: Install dependencies
# run: npm ci

# - name: Run functional test on saucelabs
# env:
# TEST_URL: ${{ env.TEST_URL }}
# run: |
# echo TEST_URL=$TEST_URL
# npm run ci-functional

# - name: Generate functional test allure report
# run: npm run functional:generate-report

# - uses: actions/upload-artifact@v4
# with:
# name: functional-test-output
# path: ./output

# - name: Upload report to GitHub page
# if: ${{ always() }}
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./e2e-reports
# destination_dir: ${{ github.run_id }}
# commit_message: "docs: 🤖 upload schedule report ${{ github.run_id }}"
# user_name: "github-actions[bot]"
# user_email: "github-actions[bot]@users.noreply.github.com"

clean_up:
needs: [static_and_unit_test, functional_test]
needs: [static_and_unit_test]
if: ${{ always() }}
name: Clean up
runs-on: ubuntu-latest
Expand All @@ -131,17 +131,17 @@ jobs:
name: unit-test-output
path: ./reports

- uses: actions/download-artifact@v4
with:
name: functional-test-output
path: ./output
# - uses: actions/download-artifact@v4
# with:
# name: functional-test-output
# path: ./output

- name: Get report info
if: ${{ always() }}
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const { getGHPageInfo } = require('./scripts/ghpage-helper')
const { getGHPageInfo } = require('./scripts/ghpage-helper.cjs')
const info = await getGHPageInfo({ context }, '${{ github.run_id }}')
console.log(info)
core.exportVariable('GH_PAGE_URL', info.ghPage)
Expand All @@ -151,13 +151,13 @@ jobs:
- name: Get build comment
if: ${{ always() }}
uses: actions/github-script@v6
uses: actions/github-script@v7
env:
TEST_URL: ${{ env.TEST_URL }}
DATE: ${{ steps.get-date.outputs.DATE }}
with:
script: |
const getComment = require('./scripts/get-comment')
const getComment = require('./scripts/get-comment.cjs')
const comment = await getComment({ context })
console.log(comment)
core.exportVariable('BUILD_COMMENT', comment)
Expand All @@ -178,7 +178,7 @@ jobs:
- name: Last check build status
if: ${{ always() }}
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
if (process.env.BUILD_COMMENT.includes('❌')) {
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lint.log
3 changes: 0 additions & 3 deletions .stylelintrc.js

This file was deleted.

Loading

0 comments on commit c713d00

Please sign in to comment.