Skip to content

Commit 1181cbb

Browse files
authored
Dwk/dev (#236)
* New package: LCSVD v1.0.0-DEV * replace travis section to CI section * replace travis section with CI section
1 parent 46a3dbd commit 1181cbb

File tree

1 file changed

+36
-27
lines changed

1 file changed

+36
-27
lines changed

README.md

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -243,36 +243,45 @@ $ git branch -D teh/SomeNewPkg
243243
3bd9afcd-55df-531a-9b34-dc642dce7b95 = { name = "RFFT", path = "RFFT" }
244244
```
245245
246-
## Accessing HolyLabRegistry in travis and appveyor tests
246+
## Accessing HolyLabRegistry in CI tests
247247
248-
This is required only if your package uses other private packages.
248+
This is required only if your package uses other packages which are registered in this HolyLabRegistry registry.
249249
250-
- Include the following lines in the script section of the `.travis.yml` file in the root directory
251-
of your package (as an example, let your package name be 'RegisterFit')
250+
- Include the following lines in the jobs section of the `CI.yml` file in the `.github/workflows/` directory
251+
of your package.
252252
253-
```
254-
script:
255-
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
256-
- julia -e 'using Pkg, LibGit2;
257-
user_regs = joinpath(DEPOT_PATH[1],"registries");
258-
mkpath(user_regs);
259-
all_registries = Dict("General" => "https://github.com/JuliaRegistries/General.git",
260-
"HolyLabRegistry" => "https://github.com/HolyLab/HolyLabRegistry.git");
261-
Base.shred!(LibGit2.CachedCredentials()) do creds
262-
for (reg, url) in all_registries
263-
path = joinpath(user_regs, reg);
264-
LibGit2.with(Pkg.GitTools.clone(url, path; header = "registry $reg from $(repr(url))", credentials = creds)) do repo end
265-
end
266-
end'
267-
- julia -e 'using Pkg; Pkg.build(); Pkg.test("RegisterFit"; coverage=false)'
268-
```
269-
270-
A similar script should be used with Appveyor (for testing on Windows). However because multiline commands and variables are nightmarish in Windows it's recommended that you move the Julia command above into a separate script that gets called from `appveyor.yml`. You can call the same script from `.travis.yml` as well to avoid code duplication. See https://github.com/HolyLab/ImagineInterface for an example.
271-
272-
- Assign your private ssh key which is paired with a public key in your Github account to the package in the Travis site.
273-
* Copy the contents of the private key ('id_ecdsa' file generated in the 'To use git protocol in GitHub' section - not 'id_ecdsa.pub') in the local machine to your clipboard.
274-
* Go to the setup page of the package in the Travis site you want to make to access this registry. (You can get there by choosing the package in your Travis repositories, clicking ‘More options’ button on the upper right corner and selecting ‘setting’ menu.)
275-
* Assign the private key in the clipboard to the ‘SSH Key’ field.
253+
```
254+
name: CI
255+
# setting ...
256+
jobs:
257+
test:
258+
# setting ...
259+
strategy:
260+
# setting ...
261+
steps:
262+
- uses: actions/checkout@v3
263+
- name: Setup SSH Keys and known_hosts # This section is required if the dependent packages include private packages in our Lab.
264+
env:
265+
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
266+
run: |
267+
echo $HOME
268+
mkdir -p ~/.ssh
269+
ssh-keyscan github.com >> ~/.ssh/known_hosts
270+
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
271+
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}" # This key must be pre-registered in the repository settings as a secrets first.
272+
- uses: julia-actions/setup-julia@v1
273+
with:
274+
version: ${{ matrix.version }}
275+
arch: ${{ matrix.arch }}
276+
- uses: julia-actions/cache@v1
277+
- name: registry_add # this section is required if the dependent packages include packages registered in the HolyLabRegistry.
278+
run: julia -e 'using Pkg; pkg"registry add General https://github.com/HolyLab/HolyLabRegistry.git"'
279+
- uses: julia-actions/julia-buildpkg@v1
280+
env: # this environment setting is also required if the dependent packages include private packages in our Lab.
281+
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
282+
HOME: /home/runner
283+
- uses: julia-actions/julia-runtest@v1
284+
```
276285
277286
## Tagging a new release
278287

0 commit comments

Comments
 (0)