Skip to content

Commit

Permalink
Run continuous intergration in a container (#4)
Browse files Browse the repository at this point in the history
* Containerisation of CI

* adding CONFIG

* Remove config file script and replace paths in CONFIG.example

* Use tagged version of container

* Flag prerelease tags

* Removed use_git argument from PandAManagerController

* Revert "Use tagged version of container"

This reverts commit 0cc1203.

---------

Co-authored-by: Tizayi Zirereza <[email protected]>
  • Loading branch information
tomtrafford and Tizayi Zirereza authored Sep 15, 2023
1 parent 6a756ec commit 8e89c39
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 65 deletions.
11 changes: 0 additions & 11 deletions .github/scripts/config-file-webcontrol.sh

This file was deleted.

53 changes: 22 additions & 31 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,60 +8,50 @@ jobs:
make_zpkg:

runs-on: ubuntu-latest

# Use container from ghcr
container:
image: ghcr.io/pandablocks/pandablocks-dev-container:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
volumes:
- ${{ github.workspace }}:/repos
- ${{ github.workspace }}/build:/build

steps:
# Git repositories
- name: Checkout Source
uses: actions/checkout@v2
with:
path: PandABlocks-webcontrol
# require history to get back to last tag for version number of branches
# Require history to get back to last tag for version number of branches
fetch-depth: 0

- name: Checkout annotypes
uses: actions/checkout@v2
with:
repository: dls-controls/annotypes
path: annotypes

- name: Checkout pymalcolm
uses: actions/checkout@v2
with:
repository: dls-controls/pymalcolm
path: pymalcolm

- name: Checkout malcolmjs
uses: actions/checkout@v2
with:
repository: dls-controls/malcolmjs
path: malcolmjs

- name: Checkout PandABlocks-rootfs
uses: actions/checkout@v2
with:
repository: PandABlocks/PandABlocks-rootfs
path: PandABlocks-rootfs

# System dependencies
- name: Install system dependencies
run: |
sudo pip install sphinx sphinx-rtd-theme docutils==0.16
# CONFIG file
- name: Generate CONFIG file
run: |
bash PandABlocks-webcontrol/.github/scripts/config-file-webcontrol.sh
cat PandABlocks-webcontrol/CONFIG
# Build
- name: Make
run: |
cd PandABlocks-webcontrol
ln -s CONFIG.example CONFIG
make zpkg
# Artifact
- name: Upload zpkg
uses: actions/upload-artifact@v2
with:
name: zpkg
path: PandABlocks-webcontrol/build/panda-webcontrol@*.zpg

release:
needs: [make_zpkg]
runs-on: ubuntu-latest
# make a release on every tag
# Make a release on every tag
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v2
Expand All @@ -74,6 +64,7 @@ jobs:
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: softprops/action-gh-release@2d72d869af3bf23602f9593a1e3fd739b80ac1eb # v0.1.12
with:
prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }}
files: zpkg/*
body: See [Changelog](CHANGELOG.rst) for more details
env:
Expand Down
33 changes: 11 additions & 22 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ on:
jobs:
build:
runs-on: ubuntu-latest

# Use container from ghcr
container:
image: ghcr.io/pandablocks/pandablocks-dev-container:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
volumes:
- ${{ github.workspace }}:/repos
- ${{ github.workspace }}/build:/build

steps:
# Git repositories
Expand All @@ -17,38 +27,17 @@ jobs:
# require history to get back to last tag for version number of branches
fetch-depth: 0

# System dependencies (required for build)
- name: Install system dependencies
run: |
sudo pip install sphinx sphinx-rtd-theme --upgrade docutils==0.16
- name: Checkout pymalcolm
uses: actions/checkout@v2
with:
repository: dls-controls/pymalcolm
path: pymalcolm

- name: Checkout malcolmjs
uses: actions/checkout@v2
with:
repository: dls-controls/malcolmjs
path: malcolmjs

- name: Checkout PandABlocks-rootfs
uses: actions/checkout@v2
with:
repository: PandABlocks/PandABlocks-rootfs
path: PandABlocks-rootfs

# CONFIG files
- name: Generate CONFIG files
run: |
sudo bash PandABlocks-webcontrol/.github/scripts/config-file-webcontrol.sh
# Build
- name: Build Docs
run: |
cd PandABlocks-webcontrol
ln -s CONFIG.example CONFIG
make docs
- name: Move to versioned directory
Expand Down
2 changes: 1 addition & 1 deletion src/panda-webcontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class TemplatedGuiPart(web.parts.GuiServerPart):
controller = pandablocks.controllers.PandAManagerController(
config_dir=args.configdir, hostname=args.hostname,
template_designs=args.templatedesigns, port=args.port, mri=args.mri,
use_git=False, doc_url_base="/fpga_docs/", poll_period=0.1)
doc_url_base="/fpga_docs/", poll_period=0.1)
process.add_controller(controller)

# Start the server
Expand Down

0 comments on commit 8e89c39

Please sign in to comment.