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

Fix github actions for SingleStore and code coverage #138

Merged
merged 1 commit into from
Jul 25, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
run: make calculate_coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@894ff025c7b54547a9a2a1e9f228beae737ad3c2
uses: codecov/codecov-action@v4

Check warning

Code scanning / Semgrep (reported by Codacy)

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Warning

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release.
with:
token: ${{ secrets.CODECOV_TOKEN }
version: "v0.1.15"
verbose: true
flags: go_tests
fail_ci_if_error: true
flags: go_tests
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
Build-and-test:
strategy:
matrix:
go-version: [1.17.x, 1.18.x, 1.19.x]
go-version: [1.17.x, 1.18.x, 1.19.x, 1.20.x, 1.21.x, 1.22.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@
run: go test -coverprofile=coverage.txt -covermode=atomic -coverpkg=github.com/muir/libschema/... ./lsmysql/...

- name: Upload coverage to Codecov
uses: codecov/codecov-action@894ff025c7b54547a9a2a1e9f228beae737ad3c2
uses: codecov/codecov-action@v4

Check warning

Code scanning / Semgrep (reported by Codacy)

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Warning

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release.
with:
token: ${{ secrets.CODECOV_TOKEN }
version: "v0.1.15"
verbose: true
flags: mysql_tests
fail_ci_if_error: true
flags: mysql_tests

6 changes: 4 additions & 2 deletions .github/workflows/pg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@
run: go test -coverprofile=coverage.txt -covermode=atomic -coverpkg=github.com/muir/libschema/... ./lspostgres/...

- name: Upload coverage to Codecov
uses: codecov/codecov-action@894ff025c7b54547a9a2a1e9f228beae737ad3c2
uses: codecov/codecov-action@v4

Check warning

Code scanning / Semgrep (reported by Codacy)

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Warning

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release.
with:
token: ${{ secrets.CODECOV_TOKEN }
version: "v0.1.15"
verbose: true
flags: pg_tests
fail_ci_if_error: true
flags: pg_tests
12 changes: 9 additions & 3 deletions .github/workflows/s2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@

- name: sanity check using mysql client
run: |
mysql -u root -ptest -e "CREATE DATABASE libschematest" -h 127.0.0.1
mysql -u root -ptest -e "CREATE DATABASE libschematest partitions 2" -h 127.0.0.1
Copy link
Owner Author

Choose a reason for hiding this comment

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

I also adjust snapshots and minimal disk. Useful?

mysql -u root -ptest -e "set global snapshots_to_keep = 1" -h 127.0.0.1
mysql -u root -ptest -e "set global minimal_disk_space = 10" -h 127.0.0.1
mysql -u root -ptest -e "set global log_file_size_partitions = 1048576" -h 127.0.0.1
mysql -u root -ptest -e "set global log_file_size_ref_dbs = 1048576" -h 127.0.0.1

- name: Check out repository code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
Expand All @@ -53,9 +57,11 @@
run: go test -coverprofile=coverage.txt -covermode=atomic -coverpkg=github.com/muir/libschema/... ./lsmysql/... ./lssinglestore/...

- name: Upload coverage to Codecov
uses: codecov/codecov-action@894ff025c7b54547a9a2a1e9f228beae737ad3c2
uses: codecov/codecov-action@v4

Check warning

Code scanning / Semgrep (reported by Codacy)

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Warning

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release.
with:
token: ${{ secrets.CODECOV_TOKEN }
version: "v0.1.15"
verbose: true
flags: singlestore_tests
fail_ci_if_error: true
flags: singlestore_tests

2 changes: 1 addition & 1 deletion lssinglestore/singlestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (p *SingleStore) CreateSchemaTableIfNotExists(ctx context.Context, _ *inter
}
if schema != "" {
_, err := d.DB().ExecContext(ctx, fmt.Sprintf(`
CREATE DATABASE IF NOT EXISTS %s
CREATE DATABASE IF NOT EXISTS %s PARTITIONS 2
Copy link
Owner Author

Choose a reason for hiding this comment

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

Does it make sense that the database where store the set of migrations that have run should have 2 partitions in production?

It's only accessed during program startup and is very tiny.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, if it's really small, 2 partitions is the way to go (it does mean that database shouldn't be used for anything else), since that's the minimum singlestore supports today.

`, schema))
if err != nil {
return errors.Wrapf(err, "Could not create libschema schema '%s'", schema)
Expand Down
Loading