Skip to content

Conversation

@connorjclark
Copy link
Collaborator

@connorjclark connorjclark commented Oct 13, 2021

This should reduce most of the burden of doing releases.

The local release testing consist(ed) of:

  1. running yarn test, yarn build-all, etc. in a local "pristine" environment. This is basically what CI does already.
  2. running the CLI in an installed npm packaged via yarn smoke. This verifies our published code doesn't have an accidental reliance on a dev dependency.
  3. some manual testing (devtools, extension, etc.)

1 is a waste of time, so I removed it.

2 could be done in GHA, so let's do it there.

3 remains.

ref #11734

@connorjclark connorjclark requested a review from a team as a code owner October 13, 2021 22:57
@connorjclark connorjclark requested review from adamraine and removed request for a team October 13, 2021 22:57
@google-cla google-cla bot added the cla: yes label Oct 13, 2021
@connorjclark connorjclark changed the title misc: simplify release process, run package-test in CI v0.0.0 Oct 13, 2021
pull_request: # run on all PRs, not just PRs to a particular branch

jobs:
if: contains(github.context.payload.pull_request.title, '/^v\d+\.\d+\.\d+/')
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably just want to run this on the release PRs. thoughts?

Copy link
Contributor

@brendankenny brendankenny Oct 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably just want to run this on the release PRs. thoughts?

one option would be to run it on every PR but with --dry-run or whatever for non-release PRs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also we'd probably want some kind of workflow_run to run it only after everything else is green?

Copy link
Collaborator Author

@connorjclark connorjclark Oct 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok so it took 9m, and the longest tests took 10m and 15m, so running all the time seems ok. And, always best to fix errors as they happen instead of pushing it off until the release manager is busy with release stuff.

--dry-run

like yarn build-all && npm pack --dry-run, just to list what files would be published?

workflow_run

granted I didn't spend long looking at this, but seems a bit complicated / not worth since the test wouldn't be the longest

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

workflow_run

granted I didn't spend long looking at this, but seems a bit complicated / not worth since the test wouldn't be the longest

I thought you were proposing moving publishing to an action. Never mind :)

@connorjclark connorjclark changed the title v0.0.0 misc: simplify release process, run package-test in CI Oct 13, 2021
- run: yarn build-report
- run: sudo apt-get install xvfb

- run: xvfb-run --auto-servernum bash $GITHUB_WORKSPACE/lighthouse-core/scripts/release/package-test.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we inline package-test.sh here? It's pretty awkward in a separate script and if the intent is to not run it locally...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a lot of bash, I prefer it being in the script, and it is nicer to test changes to it localy vs in GHA push/wait process.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a lot of bash, I prefer it being in the script, and it is nicer to test changes to it localy vs in GHA push/wait process.

well if you feel strongly that's fine, but IMO all the bash-isms make it look a lot more involved than it is :)

name: package-test

on:
  push:
    branches: [master]
  pull_request: # run on all PRs, not just PRs to a particular branch

jobs:
  package-test:
    runs-on: ubuntu-latest
    name: Package Test

    steps:
    - name: git clone
      uses: actions/checkout@v2

    - name: Use Node.js 14.x
      uses: actions/setup-node@v1
      with:
        node-version: 14.x

    - run: yarn install --frozen-lockfile --network-timeout 1000000
    - run: yarn build-report
    - run: sudo apt-get install xvfb

    - run: npm pack
    - name: Get latest package version
      run: echo "VERSION=$(echo node -e "console.log(require('./package.json').version)")" >> $GITHUB_ENV
    - run: yarn static-server &

    - name: Fresh install of packed Lighthouse
      working-directory: ./lighthouse-local-test
      run: |
        npm init -y
        npm install "$GITHUB_WORKSPACE/lighthouse-$VERSION.tgz"
        npm install lighthouse-plugin-publisher-ads

    - name: Fast run
      working-directory: ./lighthouse-local-test
      run: npm explore lighthouse -- npm run fast -- http://example.com

    - name: Packaged smoke test
      working-directory: ./lighthouse-local-test
      # Test packaged smokehouse/lighthouse using root's static-server and test fixtures.
      run: xvfb-run --auto-servernum yarn smokehouse --tests-path="$GITHUB_WORKSPACE/lighthouse-cli/test/smokehouse/test-definitions/core-tests.js" --retries=2

(ish)

### Release publicity

Note: actively undergoing changes by @exterkamp and @egsweeny.
Note 2: Not really. Ignore this.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just delete the section?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants