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

Time to switch to GitHub Actions? #92

Closed
MikaelSlevinsky opened this issue Jan 11, 2021 · 18 comments · Fixed by #93
Closed

Time to switch to GitHub Actions? #92

MikaelSlevinsky opened this issue Jan 11, 2021 · 18 comments · Fixed by #93

Comments

@MikaelSlevinsky
Copy link
Member

What is up with this message?
Screen Shot 2021-01-11 at 9 57 25 AM

@dlfivefifty
Copy link
Member

no idea, all the links error out.

Probably we should move CI to Github actions but I don't know how to do that. (GitHub actions have the annoying feature that they aren't version controlled.. shocking!)

@dlfivefifty
Copy link
Member

I don't know why we even switch to travis.com since travis.org is still working..

@hyrodium
Copy link
Collaborator

In my repository, migrating travis.org to travis.org was easy (just clicking some buttons), so I don't know why the tests are not running...

@hyrodium
Copy link
Collaborator

Taking this opportunity, I'm trying to switch Travis to GitHub Actions in my repository for an experiment.

I succeeded to enable GitHub Actions, but, I couldn't figure out how to disable the checks for travis.

image

Do you have any ideas?

@hyrodium
Copy link
Collaborator

Ah, I found it!

Settings -> Branches -> Branch protection rules -> Edit
image

So, I can help this issue.

@hyrodium
Copy link
Collaborator

Here's an instruction.

1. Configure repository on GitHub

Generate keys by DocumenterTools.jl

julia> using DocumenterTools

julia> Travis.genkeys(user="JuliaApproximation", repo="[email protected]:JuliaApproximation/FastGaussQuadrature.git")

<keys will be generated here.>

Add Deploy keys

add Deploy key which begin ssh-rsa.

example:

Add Secret key

add Secret key which which is longer than deploy key.

example:

2. Update code in the repository

Add .github/workflows/ci.yml

To install github actions, add some YAML files in .github/workflows.
In this case, we just need .github/workflows/ci.yml.

name: CI
on:
  - push
  - pull_request
jobs:
  test:
    name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        version:
          - '1.3'
          - '1.5'
          - 'nightly'
        os:
          - ubuntu-latest
          - macOS-latest
          - windows-latest
        arch:
          - x64
    steps:
      - uses: actions/checkout@v2
      - uses: julia-actions/setup-julia@v1
        with:
          version: ${{ matrix.version }}
          arch: ${{ matrix.arch }}
      - uses: actions/cache@v1
        env:
          cache-name: cache-artifacts
        with:
          path: ~/.julia/artifacts
          key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
          restore-keys: |
            ${{ runner.os }}-test-${{ env.cache-name }}-
            ${{ runner.os }}-test-
            ${{ runner.os }}-
      - uses: julia-actions/julia-buildpkg@v1
      - uses: julia-actions/julia-runtest@v1
      - uses: julia-actions/julia-processcoverage@v1
      - uses: codecov/codecov-action@v1
        with:
          file: lcov.info
  docs:
    name: Documentation
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: julia-actions/setup-julia@v1
        with:
          version: '1'
      - run: |
          julia --project=docs -e '
            using Pkg
            Pkg.develop(PackageSpec(path=pwd()))
            Pkg.instantiate()'
      - run: |
          julia --project=docs -e '
            using Documenter: doctest
            using FastGaussQuadrature
            doctest(FastGaussQuadrature)'
      - run: julia --project=docs docs/make.jl
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}

This ci.yml file is generated by PkgTemplates.jl.

Update badge in README.md

[![Build Status](https://github.com/JuliaApproximation/FastGaussQuadrature.jl/workflows/CI/badge.svg)](https://github.com/JuliaApproximation/FastGaussQuadrature.jl/actions)

3. Remove Travis

  • On Travis
    • Disable FastGaussQuadrature.jl
  • Settings -> Branches -> Branch protection rules -> Edit
    • remove travis from branch protection rules

@hyrodium
Copy link
Collaborator

GitHub actions have the annoying feature that they aren't version controlled.. shocking!)

@dlfivefifty
sorry, I didn't quite understand. Is it about versioning of this repository?

@dlfivefifty
Copy link
Member

versioning of the GitHub action: at the moment the actions are copied and pasted from somewhere else and when they change one has to fix it. Seems like a very bad design

@hyrodium
Copy link
Collaborator

Do you mean .github/workflows/ci.yml? If so, we already have .travis.yml file, so there's not much difference, I guess.
Sorry if I misunderstood.

@dlfivefifty
Copy link
Member

Touchè

@hyrodium
Copy link
Collaborator

Okay, I'll make a PR.
Could you add some keys by DocumeterTools.jl, and remove Travis from the repository?

@hyrodium
Copy link
Collaborator

These secret key and deploy key are required to deploy a document by Documenter.jl.

@dlfivefifty
Copy link
Member

OK I followed the instructions and pushed the changes, does that work?

@hyrodium
Copy link
Collaborator

Ah, sorry for confusing..., I've already sent a PR(#93).
What I would like you to do was merging the PR, and:

Could you add some keys by DocumeterTools.jl, and remove Travis from the repository?

@hyrodium
Copy link
Collaborator

hyrodium commented Jan 15, 2021

The tests have failed because the doctest is incomplete.

image

This problem is solved by this commit in PR(#93).

@hyrodium
Copy link
Collaborator

It's better if we can merge the PR(#93), but there are some conflicts.
We have the following three options to solve the problem:

1. Reset the commit and merge the PR(#93)

On your terminal

git checkout master
git pull origin master
git reset --hard bd8857cecd
git push -f origin master

and then merge #93.

2. Make a new PR to solve the doctest problem

In this case, I'll make a new PR instead of #93.

3. Add @hyrodium as collaborator for this repository, and add permission

He wil solve this problem with option1 (reset & merge PR).

@dlfivefifty
Copy link
Member

OK I merged the PR and added you as a maintainer

@hyrodium
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants