Commit c0eaf98d authored by JJ Kasper's avatar JJ Kasper Committed by Joe Haddad

Update actions config for canary jobs (#10299)

* Update actions config for canary jobs

* Update exiting for mising value and size limit test

* Update config

* Update check

* Update check

* Remove extra check
parent e3ded1ae
...@@ -9,12 +9,12 @@ name: Build, test, and deploy ...@@ -9,12 +9,12 @@ name: Build, test, and deploy
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
NEXT_TELEMETRY_DISABLED: 1
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- run: yarn install --frozen-lockfile --check-files - run: yarn install --frozen-lockfile --check-files
env:
NEXT_TELEMETRY_DISABLED: 1
- uses: actions/cache@v1 - uses: actions/cache@v1
id: cache-build id: cache-build
with: with:
...@@ -30,13 +30,15 @@ jobs: ...@@ -30,13 +30,15 @@ jobs:
with: with:
path: '.' path: '.'
key: ${{ github.sha }} key: ${{ github.sha }}
- run: yarn lint - run: yarn lint
testAll: testAll:
name: Test All name: Test All
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
env:
NEXT_TELEMETRY_DISABLED: 1
HEADLESS: true
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
...@@ -47,11 +49,7 @@ jobs: ...@@ -47,11 +49,7 @@ jobs:
with: with:
path: '.' path: '.'
key: ${{ github.sha }} key: ${{ github.sha }}
- run: node run-tests.js --timings -g ${{ matrix.group }}/6 -c 3 - run: node run-tests.js --timings -g ${{ matrix.group }}/6 -c 3
env:
NEXT_TELEMETRY_DISABLED: 1
HEADLESS: true
testsPass: testsPass:
name: thank you, next name: thank you, next
...@@ -64,48 +62,45 @@ jobs: ...@@ -64,48 +62,45 @@ jobs:
name: Test Firefox (production) name: Test Firefox (production)
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
env:
NEXT_TELEMETRY_DISABLED: 1
HEADLESS: true
steps: steps:
- uses: actions/cache@v1 - uses: actions/cache@v1
id: restore-build id: restore-build
with: with:
path: '.' path: '.'
key: ${{ github.sha }} key: ${{ github.sha }}
- run: yarn testfirefox --forceExit test/integration/production/ - run: yarn testfirefox --forceExit test/integration/production/
env:
NEXT_TELEMETRY_DISABLED: 1
HEADLESS: true
testSafari: testSafari:
name: Test Safari (production) name: Test Safari (production)
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build needs: build
if: github.ref == 'canary'
steps:
- uses: actions/cache@v1
id: restore-build
with:
path: '.'
key: ${{ github.sha }}
- run: yarn testsafari --forceExit test/integration/production/
env: env:
NEXT_TELEMETRY_DISABLED: 1 NEXT_TELEMETRY_DISABLED: 1
BROWSERSTACK: true BROWSERSTACK: true
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
saveNpmToken:
name: Potentially save npm token
runs-on: ubuntu-latest
if: github.ref == 'canary'
needs: [build, testAll]
steps: steps:
- run: ([[ ! -z $NPM_TOKEN ]] && echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc) || echo "Did not write npm token" - uses: actions/cache@v1
id: restore-build
with:
path: '.'
key: ${{ github.sha }}
- run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || yarn testsafari --forceExit test/integration/production/'
publishRelease: publishRelease:
name: Potentially publish release name: Potentially publish release
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: saveNpmToken needs: [testsPass]
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps: steps:
- uses: actions/cache@v1
id: restore-build
with:
path: '.'
key: ${{ github.sha }}
- run: ./publish-release.sh - run: ./publish-release.sh
#!/bin/sh #!/bin/bash
if git describe --exact-match
ls ~/.npmrc >/dev/null 2>&1 &&
[[ $(git describe --exact-match 2> /dev/null || :) =~ -canary ]]; if [[ ! $? -eq 0 ]];then
echo "Nothing to publish, exiting.."
exit 0;
fi
if [[ -z "$NPM_TOKEN" ]];then
echo "No NPM_TOKEN, exiting.."
exit 0;
fi
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
if [[ $(git describe --exact-match 2> /dev/null || :) =~ -canary ]];
then then
# yarn run lerna publish from-git --npm-tag canary --yes echo "Publishing canary"
echo "publishing canary" yarn run lerna publish from-git --npm-tag canary --yes
else else
echo "Did not publish canary" echo "Did not publish canary"
fi fi
if if [[ ! $(git describe --exact-match 2> /dev/null || :) =~ -canary ]];then
ls ~/.npmrc >/dev/null 2>&1 && echo "Publishing stable"
[[ ! $(git describe --exact-match 2> /dev/null || :) =~ -canary ]]; yarn run lerna publish from-git --yes
then
# yarn run lerna publish from-git --yes
echo "publishing stable"
else else
echo "Did not publish stable" echo "Did not publish stable"
fi fi
...@@ -81,7 +81,7 @@ describe('Production response size', () => { ...@@ -81,7 +81,7 @@ describe('Production response size', () => {
) )
// These numbers are without gzip compression! // These numbers are without gzip compression!
const delta = responseSizeKilobytes - 233 const delta = responseSizeKilobytes - 234
expect(delta).toBeLessThanOrEqual(0) // don't increase size expect(delta).toBeLessThanOrEqual(0) // don't increase size
expect(delta).toBeGreaterThanOrEqual(-1) // don't decrease size without updating target expect(delta).toBeGreaterThanOrEqual(-1) // don't decrease size without updating target
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment