From 2b07c3b776622025fd8ea656c7c6a1ccc0485846 Mon Sep 17 00:00:00 2001 From: Nick Logan Date: Fri, 13 Sep 2024 19:07:37 -0700 Subject: [PATCH 1/3] Add github action --- .github/workflows/tests.yml | 87 +++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..dc79e7e4 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,87 @@ +name: test + +on: [ push, pull_request ] + +jobs: + raku: + strategy: + fail-fast: false + matrix: + os: [ macos-latest, windows-latest, ubuntu-latest ] + raku-version: [ latest ] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + - uses: Raku/setup-raku@v1 + with: + raku-version: ${{ matrix.raku-version }} + + - name: Remove non-core modules included in this github action + run: raku -e 'my $site = CompUnit::RepositoryRegistry.repository-for-name(q|site|); $site.uninstall($_) for $site.installed' + + # run xt/ tests + - name: Run xt/ tests - repository.rakutest + run: raku --ll-exception -I. xt/repository.rakutest + - name: Run xt/ tests - install.rakutest + run: raku --ll-exception -I. xt/install.rakutest + + # run integration tests pre-install + - name: Test (and show for debugging purposes) --version + run: raku -I. bin/zef --version + - name: Run relative local path test + install + run: raku -I. bin/zef --debug install . + - name: Test uninstall + run: raku -I. bin/zef uninstall zef + - name: Run absolute local path test + install + run: raku -I. bin/zef install ${{ github.workspace }} + + # run integration tests post-install + - name: Test 'update' + run: zef update --debug + - name: Test --version + run: zef --version + - name: Test --help + run: zef --help + - name: Test 'locate' with short-name + run: zef locate Zef::CLI + - name: Test 'locate' with path name + run: zef locate lib/Zef/CLI.rakumod + - name: Test 'browse' + run: zef browse zef bugtracker --/open + - name: Test 'info' + run: zef info zef + - name: Test 'search' + run: zef --debug search Base64 + - name: Test 'rdepends' + run: zef --debug rdepends Base64 + - name: Test 'depends' + run: zef --debug depends Cro::SSL + - name: Test 'fetch' + run: zef --debug fetch Base64 + - name: Test installing from what 'fetch' put in ::LocalCache + run: zef --debug --/fez --/cpan --/p6c --/rea install Base64 + - name: Test 'list' + run: zef --debug --max=10 list + - name: Test 'list --installed' + run: zef --debug --installed list + - name: Test reinstallation via 'install --force-install' + run: zef --debug --force-install install Base64 + - name: Test installing .tar.gz + run: zef --debug install https://github.com/ugexe/Raku-PathTools/archive/0434191c56e0f3254ab1d756d90f9191577de5a0.tar.gz + - name: Test 'upgrade' on previously installed PathTools .tar.gz + run: zef --debug upgrade PathTools + - name: Test installing .zip + run: zef --debug install https://github.com/ugexe/Raku-Text--Table--Simple/archive/v0.0.3.zip + - name: Test remote git repo + tag + run: zef --debug install https://github.com/ugexe/Raku-Text--Table--Simple.git@v0.0.4 + - name: Test self contained installation + run: | + zef install Distribution::Common --/test + zef install Distribution::Common::Remote -to=inst#foo --contained --/test + zef uninstall Distribution::Common + raku -I inst#foo -M Distribution::Common::Remote::Github -e "" + - name: Test 'nuke' on config paths + run: zef --/confirm nuke TempDir StoreDir + - name: Test single repository update ('cached' should be 0 after previous nuke) + run: zef update cached --debug From d3a5e6a337478cd89cb19ed5207c27cc497d5539 Mon Sep 17 00:00:00 2001 From: Nick Logan Date: Mon, 16 Dec 2024 16:00:44 -0800 Subject: [PATCH 2/3] Remove appveyor and circle CI workflows --- .appveyor.yml | 95 ------------------------------------- .circleci/config.yml | 109 ------------------------------------------- 2 files changed, 204 deletions(-) delete mode 100644 .appveyor.yml delete mode 100644 .circleci/config.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index dd9254d1..00000000 --- a/.appveyor.yml +++ /dev/null @@ -1,95 +0,0 @@ -os: Visual Studio 2022 - -platform: x64 - -install: - # Enable x64 Native Tools - - '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64' - - # Workaround for path length errors during precompilation of longer repo names - - SET ZEF_CONFIG_TEMPDIR=C:\tmp - - cd C:\ - - md tmp - - # Install Perl - - appveyor-retry choco install strawberryperl --version=5.32.1.1 --allow-empty-checksums - - SET PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH% - - appveyor-retry git clone https://github.com/rakudo/rakudo.git %APPVEYOR_BUILD_FOLDER%\..\rakudo - - # Install Rakudo - - cd %APPVEYOR_BUILD_FOLDER%\..\rakudo - - perl Configure.pl --gen-moar --gen-nqp --backends=moar - - nmake install - - SET PATH=%APPVEYOR_BUILD_FOLDER%\..\rakudo\install\bin;%PATH% - - SET PATH=%APPVEYOR_BUILD_FOLDER%\..\rakudo\install\share\perl6\site\bin;%PATH% - - cd %APPVEYOR_BUILD_FOLDER% - -build: off - -test_script: - - raku -I. bin/zef --version - - # run xtests - - raku -I. xt/repository.rakutest - - raku -I. xt/install.rakutest - - # test zef test - - raku -I. bin/zef --debug --raku-test test . - - # run relative local path test + install + disable precompilation - # (we also test --/precompile-install in other ci tests here, but - # it doesn't seem to work right on appveyor) - - raku -I. bin/zef --debug install . - - # test uninstall - - raku -I. bin/zef uninstall zef - - # run absolute local path test + install - - raku -I. bin/zef install %APPVEYOR_BUILD_FOLDER% - - # change path to make sure next `zef` commands aren't using any files in cwd or lib/ - - cd %APPVEYOR_BUILD_FOLDER%\.. - - zef update --debug - - # test informational commands - - zef --version - - zef --help - - zef locate Zef::CLI - - zef locate lib/Zef/CLI.rakumod - - zef browse zef bugtracker --/open - - zef info zef - - # test bells and whistles - - zef --debug test ./zef - - zef --debug search Base64 - - zef --debug rdepends Base64 - - zef --debug depends Cro::SSL - - zef --debug fetch Base64 - # test installing from what `fetch` put in ::LocalCache - - zef --debug --/fez --/cpan --/p6c --/rea install Base64 - - - zef --debug --max=10 list - - zef --debug --installed list - - zef --debug --force-install install Base64 - - # test tar + upgrade - - zef --debug install https://github.com/ugexe/Raku-PathTools/archive/0434191c56e0f3254ab1d756d90f9191577de5a0.tar.gz - - zef --debug upgrade PathTools - - # test zip - - zef --debug install https://github.com/ugexe/Raku-Text--Table--Simple/archive/v0.0.3.zip - - # test remote git repo + tag - - zef --debug install https://github.com/ugexe/Raku-Text--Table--Simple.git@v0.0.4 - - # Test self contained installation - - zef install Distribution::Common --/test - - zef install Distribution::Common::Remote -to=inst#foo --contained --/test - - zef uninstall Distribution::Common - - raku -I inst#foo -M Distribution::Common::Remote::Github -e "" - - - zef --/confirm nuke TempDir StoreDir - - zef update cached --debug # test single repository update; should be 0 after previous nuke - - raku -I %APPVEYOR_BUILD_FOLDER% %APPVEYOR_BUILD_FOLDER%/bin/zef --/confirm nuke site home - -shallow_clone: true diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 9d5ddd28..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,109 +0,0 @@ -version: 2 - -variables: - macos: &macos - macos: - xcode: "10.2.0" - linux: &linux - machine: true - install-rakudo: &install-rakudo - run: - name: Build and install rakudo - command: | - git clone https://github.com/rakudo/rakudo.git $HOME/rakudo - cd $HOME/rakudo - perl Configure.pl --gen-moar --gen-nqp --make-install - test-zef: &test-zef - run: - name: Run tests - command: | - raku -I. bin/zef --version - - # run xtests - raku -I. xt/repository.rakutest - raku -I. xt/install.rakutest - - # test zef test - raku -I. bin/zef --debug test . - - # run relative local path test + install + disable precompilation - raku -I. bin/zef --debug --/precompile-install install . - - # test uninstall - raku -I. bin/zef uninstall zef - - # run absolute local path test + install - raku -I. bin/zef install $PWD - - # change path to make sure next `zef` commands aren't using any files in cwd or lib/ - (cd .. && zef update --debug) - - # test informational commands - zef --version - zef --help - zef locate Zef::CLI - zef locate lib/Zef/CLI.rakumod - zef browse zef bugtracker --/open - zef info zef - - # test bells and whistles - zef --debug test . - zef --debug search Base64 - zef --debug rdepends Base64 - zef --debug depends Cro::SSL - zef --debug fetch Base64 - - # test installing from what `fetch` put in ::LocalCache - zef --debug --/fez --/cpan --/p6c --/rea install Base64 - - zef --debug --max=10 list - zef --debug --installed list - zef --debug --force-install install Base64 - - # test tar + upgrade - zef --debug install https://github.com/ugexe/Raku-PathTools/archive/0434191c56e0f3254ab1d756d90f9191577de5a0.tar.gz - zef --debug upgrade PathTools - - # test zip - zef --debug install https://github.com/ugexe/Raku-Text--Table--Simple/archive/v0.0.3.zip - - # test remote git repo + tag - zef --debug install https://github.com/ugexe/Raku-Text--Table--Simple.git@v0.0.4 - - # Test self contained installation - zef install Distribution::Common --/test - zef install Distribution::Common::Remote -to=inst#foo --contained --/test - zef uninstall Distribution::Common - raku -I inst#foo -M Distribution::Common::Remote::Github -e '' - - zef --/confirm nuke TempDir StoreDir - zef update cached --debug # test single repository update; should be 0 after previous nuke - raku -I /home/circleci/project /home/circleci/project/bin/zef --/confirm nuke site home - -jobs: - test-linux: - <<: *linux - environment: - ZEF_BUILDPM_DEBUG: 1 - PATH: /home/circleci/rakudo/install/share/perl6/site/bin:/home/circleci/rakudo/install/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - steps: - - checkout - - *install-rakudo - - *test-zef - - #test-macos: - # <<: *macos - # environment: - # ZEF_BUILDPM_DEBUG: 1 - # PATH: /Users/circleci/rakudo/install/share/perl6/site/bin:/Users/circleci/rakudo/install/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - # steps: - # - checkout - # - *install-rakudo - # - *test-zef - -workflows: - version: 2 - test: - jobs: - - test-linux - #- test-macos From 9b519c7456e2a6d29be99090972ff6ce58daa314 Mon Sep 17 00:00:00 2001 From: Nick Logan Date: Mon, 16 Dec 2024 17:23:14 -0800 Subject: [PATCH 3/3] Do not persist tokens in local git config As reported by zizmor --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dc79e7e4..4b631635 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,6 +13,9 @@ jobs: steps: - uses: actions/checkout@v4 + with: + persist-credentials: false + - uses: Raku/setup-raku@v1 with: raku-version: ${{ matrix.raku-version }}