Add Github Action CI workflow
PATCH 1/1 Add Github Action CI workflow
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.
--- .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/ci.yml
.github/workflows/ci.yml new file +60 -0
@@ -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 }}
Signature · 1 line
2.27.0
Simon Glass
Reviewed-byHi Rob,
Quoted 7 lines · Rob Herring
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.
Quoted 8 lines
As part of this, the specification file name gains a 'git-describe' based version number.
Signed-off-by Rob Herring <[email protected]>--- .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/ci.yml
Questions below
Quoted 25 lines
.github/workflows/ci.yml new file +18
-0@@ -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
.github/workflows/ci.yml line 28
Quoted 10 lines
.github/workflows/ci.yml new file +10
-0+ 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?
Quoted 13 lines
.github/workflows/ci.yml new file +13
-0+ 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
.github/workflows/ci.yml line 51
Quoted 10 lines
.github/workflows/ci.yml new file +10
-0+ 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?
.github/workflows/ci.yml line 56
Quoted 5 lines
.github/workflows/ci.yml new file +5
-0+ 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?
Quoted 7 lines
.github/workflows/ci.yml new file +4
-1+ with: + files: build/latex/devicetree-specification-*.pdf + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} --2.27.0
Regards,
Simon
Quoted 14 lines · Simon Glass
Hi Rob,
Quoted 10 lines · Rob Herring
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.
Quoted 7 lines
Quoted 5 lines
Signed-off-by Rob Herring <[email protected]>--- .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/ci.ymlReviewed-by Simon Glass <[email protected]>
Thanks for looking.
Quoted 32 lines
Questions below
Quoted 29 lines
.github/workflows/ci.yml new file +22
-0@@ -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
Quoted 8 lines
.github/workflows/ci.yml line 28
Quoted 6 lines
.github/workflows/ci.yml new file +6
-0+ 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 SphinxDoes this need the capital S ?
I believe so. This is copy-paste from the TravisCI job.
Quoted 1 line
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.
Quoted 19 lines
Quoted 19 lines
.github/workflows/ci.yml new file +18
-0+ 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
Quoted 8 lines
.github/workflows/ci.yml line 51
Quoted 5 lines
.github/workflows/ci.yml new file +5
-0+ + - 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.
Quoted 7 lines
.github/workflows/ci.yml line 56
Quoted 5 lines
.github/workflows/ci.yml new file +5
-0+ 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
Quoted 66 lines · Rob Herring
Quoted 14 lines · Simon Glass
Hi Rob,
Quoted 10 lines · Rob Herring
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.
Quoted 7 lines
Quoted 5 lines
Signed-off-by Rob Herring <[email protected]>--- .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/ci.ymlReviewed-by Simon Glass <[email protected]>Thanks for looking.
Quoted 32 lines
Questions below
Quoted 29 lines
.github/workflows/ci.yml new file +22
-0@@ -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: installQuoted 8 lines
.github/workflows/ci.yml line 28
Quoted 6 lines
.github/workflows/ci.yml new file +6
-0+ 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 SphinxDoes this need the capital S ?
Quoted 7 lines
I believe so. This is copy-paste from the TravisCI job.
Quoted 1 line
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.
Signature · 1 line
Tom