From 2ef37538e5f89ef80eb2ae2525f9f62178addba2 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 16 Aug 2024 22:44:30 +0800 Subject: [PATCH 1/5] test: use unified github action yml --- .github/workflows/main.yml | 122 +------------------------------------ 1 file changed, 3 insertions(+), 119 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 87c773578..f3a9f090c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,121 +1,5 @@ name: CI - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - +on: [push, pull_request] jobs: - setup: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: cache package-lock.json - uses: actions/cache@v4 - with: - path: package-temp-dir - key: lock-${{ github.sha }} - - - name: create package-lock.json - run: npm i --package-lock-only --ignore-scripts - - - name: hack for singe file - run: | - if [ ! -d "package-temp-dir" ]; then - mkdir package-temp-dir - fi - cp package-lock.json package-temp-dir - - - name: cache node_modules - id: node_modules_cache_id - uses: actions/cache@v4 - with: - path: node_modules - key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} - - - name: install - if: steps.node_modules_cache_id.outputs.cache-hit != 'true' - run: npm ci - - lint: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v4 - - - name: restore cache from package-lock.json - uses: actions/cache@v4 - with: - path: package-temp-dir - key: lock-${{ github.sha }} - - - name: restore cache from node_modules - uses: actions/cache@v4 - with: - path: node_modules - key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} - - - name: lint - run: npm run lint - - - name: ts check - run: npm run tsc - needs: setup - - compile: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v4 - - - name: restore cache from package-lock.json - uses: actions/cache@v4 - with: - path: package-temp-dir - key: lock-${{ github.sha }} - - - name: restore cache from node_modules - uses: actions/cache@v4 - with: - path: node_modules - key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} - - - name: compile - run: npm run compile - - needs: setup - - coverage: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v4 - - - name: restore cache from package-lock.json - uses: actions/cache@v4 - with: - path: package-temp-dir - key: lock-${{ github.sha }} - - - name: restore cache from node_modules - uses: actions/cache@v4 - with: - path: node_modules - key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} - - - name: coverage - run: npm test -- --coverage - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - - needs: setup + CI: + uses: react-component/footer/.github/workflows/main.yml@master From d7822a112f7017ce91617d8d8a8470424542b29c Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 16 Aug 2024 22:45:26 +0800 Subject: [PATCH 2/5] Apply suggestions from code review --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f3a9f090c..7985e551c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,4 +2,4 @@ name: CI on: [push, pull_request] jobs: CI: - uses: react-component/footer/.github/workflows/main.yml@master + uses: react-component/footer/.github/workflows/ci.yml@main From 5f7586284c7dffaf94e15959ca0c9d7f6185034b Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 16 Aug 2024 22:47:36 +0800 Subject: [PATCH 3/5] Update .github/workflows/main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7985e551c..9f333aa79 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,4 +2,4 @@ name: CI on: [push, pull_request] jobs: CI: - uses: react-component/footer/.github/workflows/ci.yml@main + uses: react-component/footer/.github/workflows/test.yml@main From ba1cf877800df454ac55b6f2c52abae98507a090 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 16 Aug 2024 22:53:03 +0800 Subject: [PATCH 4/5] Update .github/workflows/main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9f333aa79..1e3e4359c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,4 +2,4 @@ name: CI on: [push, pull_request] jobs: CI: - uses: react-component/footer/.github/workflows/test.yml@main + uses: react-component/rc-test/.github/workflows/test.yml@main From 8b9e8ce4c829fe29215665ed6d6ebc818ee2da30 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 16 Aug 2024 22:59:42 +0800 Subject: [PATCH 5/5] Update .github/workflows/main.yml --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1e3e4359c..abd9139d5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,3 +3,4 @@ on: [push, pull_request] jobs: CI: uses: react-component/rc-test/.github/workflows/test.yml@main + secrets: inherit