All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add Github Action CI workflow
@ 2021-06-14 17:36 Rob Herring
       [not found] ` <20210614173623.1125220-1-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Rob Herring @ 2021-06-14 17:36 UTC (permalink / raw)
  To: devicetree-spec-u79uwXL29TY76Z2rM5mHXA; +Cc: Bill Mills

Travis-ci.org is going away and moving to Travis-ci.com requires some
work. It would probably involve fixing authentication issues yet again.
Instead, let's just move to a GH actions job which is fairly trivial to
setup. This has the side benefit of CI will run on anyone's fork without
further setup.

As part of this, the specification file name gains a 'git-describe'
based version number.

Signed-off-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
 .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 .github/workflows/ci.yml

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 000000000000..f8fe08d52cb0
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,60 @@
+name: Github Action CI
+
+on:
+  push:
+    branches: 
+    - '*'
+    tags:
+    - 'v*'
+  pull_request:
+    branches: 
+      master
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v2
+      with:
+        fetch-depth: 0
+
+    - name: install
+      run: |
+        sudo apt-get update
+        sudo apt-get install latexmk libalgorithm-diff-perl texlive texlive-latex-extra texlive-humanities graphviz
+        pip3 install --user mako
+        pip3 install --user typing
+        pip3 install --user Sphinx
+        pip3 install --user codespell
+
+    - name: build pdf
+      run: |
+        make latexpdf
+        git fetch --tags --force # Needed to make git-describe work
+        mv build/latex/devicetree-specification.pdf build/latex/devicetree-specification-$(git describe).pdf
+    - name: build html
+      run: make html
+    - name: build singlehtml
+      run: make singlehtml
+
+    - name: upload
+      uses: actions/upload-artifact@v2
+      with:
+        name: artifacts
+        path: |
+          build/latex/devicetree-specification-*.pdf
+
+    - name: deploy
+      uses: peaceiris/actions-gh-pages@v3
+      with:
+        github_token: ${{ secrets.GITHUB_TOKEN }}
+        publish_dir: ./build/singlehtml
+
+    - name: release
+      uses: softprops/action-gh-release@v1
+      if: startsWith(github.ref, 'refs/tags/')
+      with:
+        files: build/latex/devicetree-specification-*.pdf
+      env:
+        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Add Github Action CI workflow
       [not found] ` <20210614173623.1125220-1-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
@ 2021-06-17 19:18   ` Simon Glass
       [not found]     ` <CAPnjgZ27P9mXRBzcHeoVHF1OyLqS95NnJQ7dAvNnhMf-6XUa-w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Glass @ 2021-06-17 19:18 UTC (permalink / raw)
  To: Rob Herring; +Cc: devicetree-spec-u79uwXL29TY76Z2rM5mHXA, Bill Mills

Hi Rob,

On Mon, 14 Jun 2021 at 11:36, Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
>
> Travis-ci.org is going away and moving to Travis-ci.com requires some
> work. It would probably involve fixing authentication issues yet again.
> Instead, let's just move to a GH actions job which is fairly trivial to
> setup. This has the side benefit of CI will run on anyone's fork without
> further setup.
>
> As part of this, the specification file name gains a 'git-describe'
> based version number.
>
> Signed-off-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> ---
>  .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 60 insertions(+)
>  create mode 100644 .github/workflows/ci.yml

Reviewed-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

Questions below

>
> diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
> new file mode 100644
> index 000000000000..f8fe08d52cb0
> --- /dev/null
> +++ b/.github/workflows/ci.yml
> @@ -0,0 +1,60 @@
> +name: Github Action CI
> +
> +on:
> +  push:
> +    branches:
> +    - '*'
> +    tags:
> +    - 'v*'
> +  pull_request:
> +    branches:
> +      master
> +
> +jobs:
> +  build:
> +    runs-on: ubuntu-latest
> +
> +    steps:
> +    - uses: actions/checkout@v2
> +      with:
> +        fetch-depth: 0
> +
> +    - name: install
> +      run: |
> +        sudo apt-get update
> +        sudo apt-get install latexmk libalgorithm-diff-perl texlive texlive-latex-extra texlive-humanities graphviz
> +        pip3 install --user mako
> +        pip3 install --user typing
> +        pip3 install --user Sphinx

Does this need the capital S ? Can we use apt install instead?

> +        pip3 install --user codespell
> +
> +    - name: build pdf
> +      run: |
> +        make latexpdf
> +        git fetch --tags --force # Needed to make git-describe work
> +        mv build/latex/devicetree-specification.pdf build/latex/devicetree-specification-$(git describe).pdf
> +    - name: build html
> +      run: make html
> +    - name: build singlehtml
> +      run: make singlehtml
> +
> +    - name: upload
> +      uses: actions/upload-artifact@v2
> +      with:
> +        name: artifacts
> +        path: |
> +          build/latex/devicetree-specification-*.pdf
> +
> +    - name: deploy
> +      uses: peaceiris/actions-gh-pages@v3
> +      with:
> +        github_token: ${{ secrets.GITHUB_TOKEN }}

What do the spaces instead the {} do? From the docs it looks like this
is a quirk of github?

> +        publish_dir: ./build/singlehtml
> +
> +    - name: release
> +      uses: softprops/action-gh-release@v1
> +      if: startsWith(github.ref, 'refs/tags/')

So we don't need ${{}} around this one?

> +      with:
> +        files: build/latex/devicetree-specification-*.pdf
> +      env:
> +        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
> --
> 2.27.0
>

Regards,
Simon

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Add Github Action CI workflow
       [not found]     ` <CAPnjgZ27P9mXRBzcHeoVHF1OyLqS95NnJQ7dAvNnhMf-6XUa-w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2021-06-17 22:24       ` Rob Herring
       [not found]         ` <CAL_JsqJrvFUiqL_ehzbU3r8M+PfcjbL7Bx8a4afWN3F6-xFLbg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Rob Herring @ 2021-06-17 22:24 UTC (permalink / raw)
  To: Simon Glass; +Cc: devicetree-spec-u79uwXL29TY76Z2rM5mHXA, Bill Mills

On Thu, Jun 17, 2021 at 1:19 PM Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
>
> Hi Rob,
>
> On Mon, 14 Jun 2021 at 11:36, Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> >
> > Travis-ci.org is going away and moving to Travis-ci.com requires some
> > work. It would probably involve fixing authentication issues yet again.
> > Instead, let's just move to a GH actions job which is fairly trivial to
> > setup. This has the side benefit of CI will run on anyone's fork without
> > further setup.
> >
> > As part of this, the specification file name gains a 'git-describe'
> > based version number.
> >
> > Signed-off-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> > ---
> >  .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 60 insertions(+)
> >  create mode 100644 .github/workflows/ci.yml
>
> Reviewed-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

Thanks for looking.

>
> Questions below
>
> >
> > diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
> > new file mode 100644
> > index 000000000000..f8fe08d52cb0
> > --- /dev/null
> > +++ b/.github/workflows/ci.yml
> > @@ -0,0 +1,60 @@
> > +name: Github Action CI
> > +
> > +on:
> > +  push:
> > +    branches:
> > +    - '*'
> > +    tags:
> > +    - 'v*'
> > +  pull_request:
> > +    branches:
> > +      master
> > +
> > +jobs:
> > +  build:
> > +    runs-on: ubuntu-latest
> > +
> > +    steps:
> > +    - uses: actions/checkout@v2
> > +      with:
> > +        fetch-depth: 0
> > +
> > +    - name: install
> > +      run: |
> > +        sudo apt-get update
> > +        sudo apt-get install latexmk libalgorithm-diff-perl texlive texlive-latex-extra texlive-humanities graphviz
> > +        pip3 install --user mako
> > +        pip3 install --user typing
> > +        pip3 install --user Sphinx
>
> Does this need the capital S ?

I believe so. This is copy-paste from the TravisCI job.

> Can we use apt install instead?

Perhaps. I think the issue here was the TravisCI using ancient ubuntu
versions and we needed a newer version of Sphinx at some point. GH is
the latest LTS, so it should be new enough.

>
> > +        pip3 install --user codespell
> > +
> > +    - name: build pdf
> > +      run: |
> > +        make latexpdf
> > +        git fetch --tags --force # Needed to make git-describe work
> > +        mv build/latex/devicetree-specification.pdf build/latex/devicetree-specification-$(git describe).pdf
> > +    - name: build html
> > +      run: make html
> > +    - name: build singlehtml
> > +      run: make singlehtml
> > +
> > +    - name: upload
> > +      uses: actions/upload-artifact@v2
> > +      with:
> > +        name: artifacts
> > +        path: |
> > +          build/latex/devicetree-specification-*.pdf
> > +
> > +    - name: deploy
> > +      uses: peaceiris/actions-gh-pages@v3
> > +      with:
> > +        github_token: ${{ secrets.GITHUB_TOKEN }}
>
> What do the spaces instead the {} do? From the docs it looks like this
> is a quirk of github?

I don't know really.

> > +        publish_dir: ./build/singlehtml
> > +
> > +    - name: release
> > +      uses: softprops/action-gh-release@v1
> > +      if: startsWith(github.ref, 'refs/tags/')
>
> So we don't need ${{}} around this one?

Evidently not. On both of these, I just follow what the action's docs
say to add.

It's nice and worrying at the same time to just use other people's actions.

Rob

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Add Github Action CI workflow
       [not found]         ` <CAL_JsqJrvFUiqL_ehzbU3r8M+PfcjbL7Bx8a4afWN3F6-xFLbg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2021-06-17 22:31           ` Tom Rini
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2021-06-17 22:31 UTC (permalink / raw)
  To: Rob Herring
  Cc: Simon Glass, devicetree-spec-u79uwXL29TY76Z2rM5mHXA, Bill Mills

[-- Attachment #1: Type: text/plain, Size: 2764 bytes --]

On Thu, Jun 17, 2021 at 04:24:12PM -0600, Rob Herring wrote:
> On Thu, Jun 17, 2021 at 1:19 PM Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
> >
> > Hi Rob,
> >
> > On Mon, 14 Jun 2021 at 11:36, Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> > >
> > > Travis-ci.org is going away and moving to Travis-ci.com requires some
> > > work. It would probably involve fixing authentication issues yet again.
> > > Instead, let's just move to a GH actions job which is fairly trivial to
> > > setup. This has the side benefit of CI will run on anyone's fork without
> > > further setup.
> > >
> > > As part of this, the specification file name gains a 'git-describe'
> > > based version number.
> > >
> > > Signed-off-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> > > ---
> > >  .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++++++++++++++
> > >  1 file changed, 60 insertions(+)
> > >  create mode 100644 .github/workflows/ci.yml
> >
> > Reviewed-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> 
> Thanks for looking.
> 
> >
> > Questions below
> >
> > >
> > > diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
> > > new file mode 100644
> > > index 000000000000..f8fe08d52cb0
> > > --- /dev/null
> > > +++ b/.github/workflows/ci.yml
> > > @@ -0,0 +1,60 @@
> > > +name: Github Action CI
> > > +
> > > +on:
> > > +  push:
> > > +    branches:
> > > +    - '*'
> > > +    tags:
> > > +    - 'v*'
> > > +  pull_request:
> > > +    branches:
> > > +      master
> > > +
> > > +jobs:
> > > +  build:
> > > +    runs-on: ubuntu-latest
> > > +
> > > +    steps:
> > > +    - uses: actions/checkout@v2
> > > +      with:
> > > +        fetch-depth: 0
> > > +
> > > +    - name: install
> > > +      run: |
> > > +        sudo apt-get update
> > > +        sudo apt-get install latexmk libalgorithm-diff-perl texlive texlive-latex-extra texlive-humanities graphviz
> > > +        pip3 install --user mako
> > > +        pip3 install --user typing
> > > +        pip3 install --user Sphinx
> >
> > Does this need the capital S ?
> 
> I believe so. This is copy-paste from the TravisCI job.
> 
> > Can we use apt install instead?
> 
> Perhaps. I think the issue here was the TravisCI using ancient ubuntu
> versions and we needed a newer version of Sphinx at some point. GH is
> the latest LTS, so it should be new enough.

On a slight tangent, perhaps a requirements.txt so that in CI you just:
pip3 install --user --requirement path/to/requirements.txt

and as a bonus it documents what modules someone needs to build outside
of CI and future module needs are handled without a CI change.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-17 22:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-14 17:36 [PATCH] Add Github Action CI workflow Rob Herring
     [not found] ` <20210614173623.1125220-1-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2021-06-17 19:18   ` Simon Glass
     [not found]     ` <CAPnjgZ27P9mXRBzcHeoVHF1OyLqS95NnJQ7dAvNnhMf-6XUa-w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-17 22:24       ` Rob Herring
     [not found]         ` <CAL_JsqJrvFUiqL_ehzbU3r8M+PfcjbL7Bx8a4afWN3F6-xFLbg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-17 22:31           ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.