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

CI: migrate from Bors to GitHub Merge Queue; also, refactor some code, and add some more unit tests #477

Merged
merged 25 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c009800
Run the integration tests on the `merge_group` event
DilumAluthge Dec 1, 2023
ad7b6e4
Run the unit tests on the `merge_group` event
DilumAluthge Dec 1, 2023
260c265
Delete `bors.toml` (the Bors config file)
DilumAluthge Dec 1, 2023
963c931
CompatHelper's own Project.toml: add compat entries for our own test …
DilumAluthge Dec 1, 2023
afbe35c
Update .github/workflows/ci_integration.yml
ericphanson Dec 2, 2023
c87ada5
Update ci_integration.yml
ericphanson Dec 2, 2023
02a8498
Upload code coverage from the unit tests
DilumAluthge Dec 2, 2023
1de0827
Integration tests: immediately error if this is a PR build
DilumAluthge Dec 2, 2023
2873710
Mark the integration tests as "skipped" on PR builds (#479)
DilumAluthge Dec 2, 2023
a60d001
Simplify the job name of the integration tests job
DilumAluthge Dec 2, 2023
c9d9d97
Do some debugging
DilumAluthge Dec 2, 2023
556391c
Revert the debugging commit
DilumAluthge Dec 2, 2023
c4c9328
Don't use a matrix for the integration test job
DilumAluthge Dec 2, 2023
69b0e8c
Do some debugging
DilumAluthge Dec 2, 2023
9b7249f
Revert the debugging commit
DilumAluthge Dec 2, 2023
7b839ca
Delete some commented-out lines
DilumAluthge Dec 2, 2023
ff0d33d
Fix a comment
DilumAluthge Dec 2, 2023
89b737d
add codecov threshold (#480)
ericphanson Dec 2, 2023
268c6b8
Update codecov.yml
ericphanson Dec 2, 2023
e781618
Apply suggestions from code review
ericphanson Dec 2, 2023
f48fe71
Update codecov.yml
ericphanson Dec 2, 2023
ef01653
try to make two settings exclusive
ericphanson Dec 2, 2023
5b3e9c6
Refactor some code, and increase the unit test code coverage for `src…
DilumAluthge Dec 3, 2023
5487c99
Revert the changes to `codecov.yml` (#482)
DilumAluthge Dec 4, 2023
218e9ce
Lower Codecov threshold to 99% because of GitHub Merge Queue limitati…
DilumAluthge Jan 8, 2024
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
27 changes: 10 additions & 17 deletions .github/workflows/ci_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,28 @@ name: CI (integration tests)
# GitHub's abuse rate limits.

on:
merge_group: # GitHub merge queue
pull_request: # but we will skip the integration tests on PR builds, to avoid hitting rate limits
push:
branches:
- master
- staging
- trying
concurrency:
group: integration-tests-global-lock
cancel-in-progress: false
jobs:
integration:
if: github.event_name == 'push'
name: Integration/Julia ${{ matrix.version }}/${{ matrix.os }}/${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 1
fail-fast: true
matrix:
arch:
- x64
os:
- ubuntu-latest
version:
- '1'
# We don't actually want to run integration tests on pull requests,
# because we want to avoid hitting rate limits.
# So, if this is a PR build, mark the integration tests as "skipped".
if: github.event_name != 'pull_request'
name: Integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
version: '1'
arch: x64
- uses: actions/cache@v3
env:
cache-name: cache-artifacts
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/ci_unit.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: CI (unit tests)
on:
merge_group: # GitHub merge queue
pull_request:
push:
branches:
- master
- staging
- trying
tags: '*'
workflow_dispatch:
jobs:
Expand Down Expand Up @@ -44,6 +43,11 @@ jobs:
- uses: julia-actions/julia-runtest@v1
env:
COMPATHELPER_RUN_INTEGRATION_TESTS: "false"
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v3
with:
file: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
documentation:
name: Documentation
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[compat]
Aqua = "0.8"
Base64 = "1"
Dates = "1"
GitForge = "0.4"
Mocking = "0.7"
MultilineStrings = "0.1"
Pkg = "1"
Random = "<0.0.1, 1"
RegistryInstances = "0.1"
SHA = "0.7, 1"
TOML = "1"
Test = "<0.0.1, 1"
TimeZones = "1"
UUIDs = "1"
julia = "1.6"
Expand Down
20 changes: 0 additions & 20 deletions bors.toml

This file was deleted.

8 changes: 7 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@ coverage:
default:
target: auto
minimum:
target: "100%"
# We want to enforce 100%.
# The Unit Tests + Integration Tests hit 100%.
# But the Unit Tests alone only hit 99.49%.
# And so, because of GitHub Merge Queue limitations,
# we need to set this threshold to 99%.
# target: "100%"
target: "99%"
10 changes: 10 additions & 0 deletions src/dependencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,13 @@ function get_latest_version_from_registries!(

return deps
end

function populate_dep_versions_from_reg!(deps; options)
if options.use_existing_registries
get_existing_registries!(deps, options.depot; options)
else
get_latest_version_from_registries!(deps, options.registries; options)
end

return nothing
end
6 changes: 1 addition & 5 deletions src/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ function main(
project_file = @mock joinpath(local_clone_path, subdir, "Project.toml")
deps = get_project_deps(project_file; include_jll=options.include_jll)

if options.use_existing_registries
get_existing_registries!(deps, options.depot; options)
else
get_latest_version_from_registries!(deps, options.registries; options)
end
populate_dep_versions_from_reg!(deps; options)

for dep in deps
pr = @mock make_pr_for_new_version(
Expand Down
32 changes: 32 additions & 0 deletions test/dependencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,35 @@ end
end
end
end

@testset "populate_dep_versions_from_reg!" begin
# For this test, we will just use CompatHelper's own `Project.toml` file.
project_file = joinpath(pkgdir(CompatHelper), "Project.toml")

# Just for this test, we hardcode this list
unregistered_stdlibs = [
"Base64",
"Dates",
"Pkg",
"UUIDs",
]

@test ispath(project_file)
@test isfile(project_file)
for use_existing_registries in [true, false]
options = CompatHelper.Options(;
use_existing_registries,
)
deps = CompatHelper.get_project_deps(project_file)
for dep in deps
@test dep.latest_version === nothing
end
CompatHelper.populate_dep_versions_from_reg!(deps; options)
for dep in deps
if !(dep.package.name in unregistered_stdlibs)
@test dep.latest_version isa VersionNumber
@test dep.latest_version > v"0"
end
end
end
end
Loading