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

Refactor smoke tests to use submodules #2702

Merged
merged 8 commits into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ jobs:
- build
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: 'recursive'
Comment on lines +181 to +183
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the extent of the changes to our actions. This pulls in the submodules recursively, so they always reflect the latest commit to main every time they run.


- name: Setup Node
uses: actions/setup-node@v2
Expand All @@ -203,11 +205,11 @@ jobs:
cache-node_modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-

- name: Install NPM Dependencies
run: yarn install --prefer-offline --frozen-lockfile --ignore-engines --registry https://registry.npmjs.org --network-timeout 300000
# NOTE: Do NOT use `--frozen-lockfile` here! The lockfile needs to be updated in order to pull the submodules into the monorepo
run: yarn install --prefer-offline --ignore-engines --registry https://registry.npmjs.org --network-timeout 300000
env:
CI: true

# Turbo seems to fail on Windows, so run a custom script directly.
- name: Test
run: yarn test:smoke

Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,32 +61,3 @@ jobs:
body: >
This PR is auto-generated by a nightly GitHub action.
It should automatically be merged if tests pass.

smoke-sync:
if: github.repository_owner == 'withastro'
runs-on: ubuntu-latest
steps:
- name: Check out code using Git
uses: actions/checkout@v2
- name: Set Node version to 16
uses: actions/setup-node@v2
with:
node-version: 16
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-engines --ignore-scripts
- name: Sync smoke tests
run: node scripts/smoke/sync.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Pull Request
id: createpr
uses: peter-evans/create-pull-request@v3
with:
branch: ci/smoke-sync
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: '[ci] update smoke tests (remote)'
title: '[ci] update smoke tests (remote)'
body: >
This PR is auto-generated by a nightly GitHub action.
It should automatically be merged if tests pass.
8 changes: 8 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[submodule "smoke/docs"]
path = smoke/docs
url = [email protected]:withastro/docs.git
branch = main
[submodule "smoke/astro.build"]
path = smoke/astro.build
url = [email protected]:withastro/astro.build.git
branch = main
Comment on lines +1 to +8
Copy link
Member Author

Choose a reason for hiding this comment

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

This points ./smoke/docs to [email protected]:withastro/docs.git and smoke/astro.build to [email protected]:withastro/astro.build.git. They both should reflect the main branch.

By default, git pull doesn't populate these directories unless you explicitly opt-in to that behavior (which most users won't need to do)

Copy link
Member Author

Choose a reason for hiding this comment

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

I should mention that users won't do this often, but our smoke test action can specifically populate them just for that run. Seems much better than the previous system!

97 changes: 0 additions & 97 deletions scripts/smoke/sync.js

This file was deleted.

1 change: 1 addition & 0 deletions smoke/astro.build
Submodule astro.build added at d3d0b5
130 changes: 0 additions & 130 deletions smoke/astro.build-main/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions smoke/astro.build-main/README.md

This file was deleted.

33 changes: 0 additions & 33 deletions smoke/astro.build-main/astro.config.ts

This file was deleted.

33 changes: 0 additions & 33 deletions smoke/astro.build-main/package.json

This file was deleted.

Loading