Skip to content

Commit

Permalink
applied PackageJanitor
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed-barakat committed Nov 3, 2022
1 parent 936d30e commit 0cdca9e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 10 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ jobs:
steps:
# keep workflow active even if repository has no activity for 60 days (do not execute for pull requests)
- run: '[ "$GITHUB_EVENT_NAME" = "pull_request" ] || curl --fail -X PUT -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/$GITHUB_REPOSITORY/actions/workflows/Tests.yml/enable'
- uses: actions/checkout@v1
- run: mkdir -p /home/gap/.gap/pkg/
- run: sudo cp -a $GITHUB_WORKSPACE /home/gap/.gap/pkg/
- run: sudo chown -R gap:gap /home/gap/.gap/pkg/
- uses: actions/checkout@v3
- run: cp -a $GITHUB_WORKSPACE /home/gap/.gap/pkg/
- run: |
export HOME="/home/gap"
cd /home/gap/.gap/pkg/
Expand Down Expand Up @@ -53,7 +51,7 @@ jobs:
[ -d "homalg_project/homalg" ] && make -C "homalg_project/homalg" doc
[ -d "homalg_project/Modules" ] && make -C "homalg_project/Modules" doc
[ -d "Toposes" ] && make -C "Toposes" doc
TERM=dumb make -C CatReps -j $(nproc) --output-sync ci-test
make -C CatReps -j $(nproc) --output-sync ci-test
cp ./CatReps/.codecov.yml ./
(cd CatReps && LANG=C.UTF-8 python3 process_coverage.py)
[ "$GITHUB_EVENT_NAME" != "schedule" ] && [ "${{ matrix.image }}" = "ghcr.io/homalg-project/gap-docker-master:latest" ] && ./CatReps/upload_codecov.sh
Expand All @@ -62,6 +60,7 @@ jobs:
cd CatReps
CUR_SHA=$(git rev-parse --verify HEAD)
if [ "${{ matrix.image }}" = "ghcr.io/homalg-project/gap-docker:latest" ] && [ "$CUR_SHA" = "$(git rev-parse origin/master)" ] && [ $(dirname "$GITHUB_REPOSITORY") = "homalg-project" ]; then \
git fetch origin gh-pages; \
git worktree add gh-pages/ gh-pages || (echo "There was an error. Make sure there is a branch named 'gh-pages'. See https://github.com/homalg-project/PackageJanitor#error-there-was-an-error-make-sure-there-is-a-branch-named-gh-pages"; exit 1); \
git checkout master; \
LANG=C.UTF-8 ./make_dist.sh --token "${{ secrets.GITHUB_TOKEN }}"; \
Expand Down
2 changes: 1 addition & 1 deletion PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ PackageDoc := rec(
),

Dependencies := rec(
GAP := ">= 4.11.1",
GAP := ">= 4.12.1",
NeededOtherPackages := [
[ "GAPDoc", ">= 1.5" ],
[ "CAP", ">= 2022.09-17" ],
Expand Down
30 changes: 27 additions & 3 deletions ci_gaprc
Original file line number Diff line number Diff line change
@@ -1,12 +1,36 @@
# Prefer GAPInfo.UserGapRoot over other package directories to prevent accidentally testing package
# versions distributed with GAP.
(function()

FORCE_LOADING_FROM_USER_GAP_ROOT := function ( )
local name, package_info, pos;
for name in RecNames( GAPInfo.PackagesInfo ) do
package_info := GAPInfo.PackagesInfo.(name);
pos := PositionProperty( package_info, info -> StartsWith( info.InstallationPath, GAPInfo.UserGapRoot ) );
if pos <> fail then
SetPackagePath( name, package_info[pos].InstallationPath );
# work around https://github.com/gap-system/gap/pull/5178
if IsBound( GAPInfo.PackagesLoaded.(name) ) then
if StartsWith( GAPInfo.PackagesLoaded.(name)[1], GAPInfo.UserGapRoot ) then
continue;
else
Error( "package already loaded at ", GAPInfo.PackagesLoaded.(name)[1] );
fi;
else
SetPackagePath( name, package_info[pos].InstallationPath );
fi;
fi;
od;
end)();
end;

FORCE_LOADING_FROM_USER_GAP_ROOT( );

MakeReadWriteGlobal( "InitializePackagesInfoRecords" );
FORCE_LOADING_FROM_USER_GAP_ROOT_InitializePackagesInfoRecords_orig := InitializePackagesInfoRecords;
InitializePackagesInfoRecords := function ( args... )
local old_PackagesInfo;
old_PackagesInfo := GAPInfo.PackagesInfo;
CallFuncList( FORCE_LOADING_FROM_USER_GAP_ROOT_InitializePackagesInfoRecords_orig, args );
if not IsIdenticalObj( old_PackagesInfo, GAPInfo.PackagesInfo ) then
FORCE_LOADING_FROM_USER_GAP_ROOT( );
fi;
end;
MakeReadOnlyGlobal( "InitializePackagesInfoRecords" );
2 changes: 1 addition & 1 deletion upload_codecov.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ shasum -a 256 -c codecov.SHA256SUM

# execute
chmod +x codecov
./codecov -Z || ./codecov -Z || ./codecov -Z
./codecov -Z || (sleep 30; ./codecov -Z || (sleep 30; ./codecov -Z))

0 comments on commit 0cdca9e

Please sign in to comment.