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

[2.7] Resolve conflicts in .github/workflows/test.yaml #11253

42 changes: 26 additions & 16 deletions .github/workflows/docusaurus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
branches:
- master
jobs:
deploy:
name: Publish Docusaurus
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -23,19 +23,29 @@ jobs:
- name: Build website
run: cd docusaurus/ && yarn build

# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Publish Docusaurus
uses: peaceiris/actions-gh-pages@v3
- name: Upload artifact
if: ${{ github.event_name == 'push' && github.repository_owner == 'rancher' }}
uses: actions/upload-pages-artifact@v3
with:
deploy_key: ${{ secrets.GH_PAGES_DEPLOY_KEY }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./docusaurus/build
# Remove .gitignore from excludes
exclude_assets: ''
# The following lines assign commit authorship to the official
# GH-Actions bot for deploys to `gh-pages` branch:
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
path: ./docusaurus/build
retention-days: 10
compression-level: 9

# Seperate the deploy job to isolate write permissions
deploy:
name: Publish
if: ${{ github.event_name == 'push' && github.repository_owner == 'rancher' }}
runs-on: ubuntu-latest
needs: build

# This is required to avoid https://github.com/actions/deploy-pages/issues/271
environment:
name: github-pages

permissions:
pages: write
id-token: write

steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
56 changes: 6 additions & 50 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,60 +159,16 @@ jobs:

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Run tests
uses: ./.github/actions/lint

coverage:
if: "!contains( github.event.pull_request.labels.*.name, 'ci/skip-e2e')"
runs-on: ubuntu-latest
needs:
- unit-test
- e2e-test
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: actions/setup-node@v3
with:
node-version: '14.x'

- name: Download Coverage Artifacts
uses: actions/download-artifact@v2
with:
name: ${{github.run_number}}-${{github.run_attempt}}-coverage

- name: Merge coverage files
run: |
ls
yarn coverage
ls coverage

# Job is flaky now and then, but we do not want to interrupt the development flow
- name: Upload unit test coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unit
files: ./coverage/coverage-unit.json
fail_ci_if_error: false

- name: Upload e2e test coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: e2e
files: ./coverage/coverage-e2e.json
fail_ci_if_error: false

- name: Upload merged coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: merged
files: ./coverage/coverage.json
fail_ci_if_error: false

- name: Install packages
run: yarn install:ci

- name: Run linters
run: yarn lint
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ jobs:
with:
version: v3.8.0

- name: Setup yq
uses: chrisdickinson/[email protected]
with:
yq-version: v4.28.2

- name: Setup Nodejs and npm
uses: actions/setup-node@v3
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ jobs:
with:
version: v3.8.0

- name: Setup yq
uses: chrisdickinson/[email protected]
with:
yq-version: v4.28.2

- name: Setup Nodejs and npm
uses: actions/setup-node@v3
with:
Expand Down
Loading