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

chore: run all integration tests in CI #323

Merged
merged 37 commits into from
Jul 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
52644d8
Updated cmd/go_deps to reference the github-markdown-toc.go and
cgrindel Jul 21, 2023
10b0566
Ran tidy
cgrindel Jul 21, 2023
0a4a660
Brought over the ci workflow rules and tools
cgrindel Jul 21, 2023
383f36b
Update with bare bones ci.yml
cgrindel Jul 21, 2023
3e348ee
Add concurrency to ci.yml
cgrindel Jul 21, 2023
9881bad
Added examples/bzlformat/simple to ci workflow generation
cgrindel Jul 21, 2023
e045cdb
Added examples:all_test_params to ci workflow
cgrindel Jul 21, 2023
50e6468
Add markdown examples
cgrindel Jul 21, 2023
6da204d
Add updatesrc
cgrindel Jul 21, 2023
af46679
Add missing_pkgs_tests
cgrindel Jul 21, 2023
4ce495f
Refactor integration tests to follow naming pattern
cgrindel Jul 21, 2023
b80186d
Remove test_example action
cgrindel Jul 21, 2023
7d9bd24
Change name for root smoke_integration_tests.
cgrindel Jul 21, 2023
30f5346
Replaced alias with test_suite
cgrindel Jul 21, 2023
b73a09f
Fix missing_pkgs_tests unbound variable error
cgrindel Jul 22, 2023
8d5eca1
Update to latest 7.0.0-prerelease
cgrindel Jul 22, 2023
6acb9c8
Regenerate CI workflow
cgrindel Jul 22, 2023
3e9606b
Add set_up_bazel to integration tests.
cgrindel Jul 22, 2023
e52f4d4
Add debug to integration tests
cgrindel Jul 22, 2023
77caba7
Remove commented code
cgrindel Jul 22, 2023
f9f0fce
Remove unused input
cgrindel Jul 22, 2023
fec9d42
Remove legacy WORKSPACE
cgrindel Jul 22, 2023
066324b
Ignore child_workspace.bazelrc files
cgrindel Jul 22, 2023
817151b
Only configure bzlmod for child workspaces.
cgrindel Jul 22, 2023
1d35258
Add try-import child_workspace.bazelrc to select child workspaces.
cgrindel Jul 22, 2023
3bdea52
Update the other child workspaces with try-import of
cgrindel Jul 22, 2023
c609b4c
Enable bzlmod for the parent workspace.
cgrindel Jul 22, 2023
893b63d
Remove configure_bzlmod from tidy_and_test. The parent always runs with
cgrindel Jul 22, 2023
b5c5361
Be sure to expose GitHub required environment variables.
cgrindel Jul 22, 2023
11edbd0
Pass the GH token to the tests and set the env variable.
cgrindel Jul 22, 2023
19cdf6c
Remove action_env for GH env vars
cgrindel Jul 23, 2023
583b651
Delete commented code
cgrindel Jul 23, 2023
cc22c76
Use the specified Bazel binary in tidy_all_test.
cgrindel Jul 23, 2023
af2b999
Remove bazelrc imports from child workspaces in tidy_all_test.
cgrindel Jul 23, 2023
5196959
Ran tidy
cgrindel Jul 23, 2023
f6af22e
Add comment to tidy_all_test child workspace bazelrc files.
cgrindel Jul 23, 2023
5326502
Fix formatting
cgrindel Jul 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ import %workspace%/ci.bazelrc
# import ci.bazelrc and they do not have a //build:execution_env flag.
build:ci --//build:execution_env=ci

# The parent workspace always runs with bzlmod enabled.
common --enable_bzlmod
build --@cgrindel_bazel_starlib//bzlmod:enabled

# Try to import a local.rc file; typically, written by CI
try-import %workspace%/local.bazelrc

4 changes: 2 additions & 2 deletions .github/actions/configure_bzlmod/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ runs:
if: inputs.enabled == 'true'
shell: bash
run: |
cat >> "shared.bazelrc" <<EOF
cat >> "child_workspace.bazelrc" <<EOF
# Override earlier settings
common --enable_bzlmod
build --@cgrindel_bazel_starlib//bzlmod:enabled
Expand All @@ -21,7 +21,7 @@ runs:
if: inputs.enabled != 'true'
shell: bash
run: |
cat >> "shared.bazelrc" <<EOF
cat >> "child_workspace.bazelrc" <<EOF
# Override earlier settings
common --noenable_bzlmod
build --no@cgrindel_bazel_starlib//bzlmod:enabled
Expand Down
29 changes: 29 additions & 0 deletions .github/actions/execute_test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Execute Test

inputs:
test_target:
description: The test target to execute.
required: true
bzlmod_enabled:
description: Boolean value that specifies whether bzlmod should be enabled.
required: true
github_token:
description: The Github token to authenticate gh CLI.
required: true

runs:
using: composite
steps:
- name: Execute Test
shell: bash
env:
TEST_TARGET: ${{ inputs.test_target }}
BZLMOD_ENABLED: ${{ inputs.bzlmod_enabled }}
# The tests make use of Github-specific functionality (e.g. gh).
GITHUB_TOKEN: ${{ inputs.github_token }}
run: |
if [[ "${BZLMOD_ENABLED}" == "false" ]] && [[ "${TEST_TARGET}" =~ ^@@ ]]; then
# Strip the first @ from test target
TEST_TARGET="${TEST_TARGET#@}"
fi
bazelisk test "${TEST_TARGET}"
39 changes: 0 additions & 39 deletions .github/actions/test_example/action.yml

This file was deleted.

12 changes: 11 additions & 1 deletion .github/actions/tidy_and_test/action.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
name: Tidy and Test
# inputs: []

inputs:
github_token:
description: The Github token to authenticate gh CLI.
required: true

runs:
using: composite
steps:
- name: Ensure everything is tidy
shell: bash
env:
# The tests make use of Github-specific functionality (e.g. gh).
GITHUB_TOKEN: ${{ inputs.github_token }}
run: |
bazelisk run //:tidy_check

- name: Execute Tests
shell: bash
env:
# The tests make use of Github-specific functionality (e.g. gh).
GITHUB_TOKEN: ${{ inputs.github_token }}
run: |
bazelisk test //...
Loading