-
Notifications
You must be signed in to change notification settings - Fork 17
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
ci: add Tiobe TICS nightly workflow with coverage #225
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: Tiobe TICS nightly report | ||
|
||
on: | ||
schedule: | ||
# Runs every midnight | ||
- cron: '0 0 * * *' | ||
pull_request: | ||
paths: | ||
- .github/workflows/tiobe-tics-cron.yaml | ||
|
||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
TICS: | ||
permissions: | ||
contents: read | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checking out repo | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
# pylint and flake8 are required by TICSQServer. | ||
pip install pylint flake8 | ||
pip install -r test/performance/requirements-test.txt | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.22" | ||
|
||
- name: go mod download | ||
run: go mod download | ||
|
||
- name: Run Tests with Coverage | ||
run: | | ||
set -eux -o pipefail | ||
|
||
# TICS requires us to have the test results in cobertura xml format under the | ||
# directory used below | ||
sudo make go.coverage | ||
go install github.com/boumenot/gocover-cobertura@latest | ||
mkdir -p .coverage | ||
gocover-cobertura < coverage.txt > .coverage/coverage.xml | ||
|
||
- name: Build Project | ||
run: | | ||
set -eux -o pipefail | ||
|
||
# We load the dqlite libs here instead of doing through make because TICS | ||
# will try to build parts of the project itself | ||
sudo add-apt-repository -y ppa:dqlite/dev | ||
sudo apt install libdqlite1.17-dev | ||
|
||
# We need to have our project built | ||
sudo make clean | ||
sudo make -j static | ||
|
||
- name: Install and Run TICS | ||
run: | | ||
export TICSAUTHTOKEN=${{ secrets.TICSAUTHTOKEN }} | ||
|
||
# NOTE(aznashwan): TiCS install script doesn't define defaults; cannot '-u' | ||
set -ex -o pipefail | ||
|
||
# Install the TICS and staticcheck | ||
go install honnef.co/go/tools/cmd/[email protected] | ||
. <(curl --silent --show-error 'https://canonical.tiobe.com/tiobeweb/TICS/api/public/v1/fapi/installtics/Script?cfg=default&platform=linux&url=https://canonical.tiobe.com/tiobeweb/TICS/') | ||
|
||
# Performance tests are importing a local test_util module. Needed for pylint. | ||
export PYTHONPATH="$(pwd)/test/performance/tests/" | ||
|
||
# TICSQServer will try to build the project. We need a few environment variables | ||
# for it to succeed. Based on make static / "hack/static-dqlite.sh". | ||
export INSTALL_DIR="$(pwd)/hack/.deps/static" | ||
export PATH="${PATH}:${INSTALL_DIR}/musl/bin" | ||
export CC=musl-gcc | ||
export CGO_CFLAGS="-I${INSTALL_DIR}/include" | ||
export CGO_LDFLAGS="-L${INSTALL_DIR}/lib -luv -ldqlite -llz4 -lsqlite3 -Wl,-z,stack-size=1048576" | ||
|
||
TICSQServer -project ${{ github.event.repository.name }} -tmpdir /tmp/tics -branchdir "$GITHUB_WORKSPACE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little style suggestion. We could also set the variables under
env:
in the step as described here: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#defining-environment-variables-for-a-single-workflowThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can leave this as is. These env vars include other env vars, and the
env:
section does not allow for this type of thing, and the result would be worse than the current version, especially for$PATH
.