Skip to content

Commit 50717e0

Browse files
committed
Dev container image build using CI pipeline
1 parent 3b55e49 commit 50717e0

2 files changed

Lines changed: 46 additions & 1 deletion

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build and Publish Dev Container
2+
3+
on:
4+
workflow_dispatch: # Manually trigger a workflow run using the GitHub API, GitHub CLI, or the GitHub UI.
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- .devcontainer/*
10+
- .python-version
11+
- pyproject.toml
12+
schedule:
13+
- cron: '30 15 10 * *'
14+
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
env:
20+
REGISTRY: ghcr.io
21+
IMAGE_NAME: ${{ github.repository }}-dev-container
22+
23+
jobs:
24+
build-and-publish:
25+
if: github.repository == 'UCREL/pymusas'
26+
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- uses: actions/checkout@v5
31+
32+
- name: Login to GitHub Container Registry
33+
uses: docker/login-action@v3
34+
with:
35+
registry: ${{ env.REGISTRY }}
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Pre-build dev container image
40+
uses: devcontainers/ci@8bf61b26e9c3a98f69cb6ce2f88d24ff59b785c6
41+
with:
42+
imageName: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
43+
cacheFrom: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
44+
push: always

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2929
- `scripts/create_temporary_version.py` - this creates a temporary `pyproject.toml` with a unique version of the project so that functional testing through `make functional-tests` does not use a cached/out-dated version of the codebase once the code base has been built while still using cached Python packages for the packages `pymusas` depends on.
3030
- `makefile` the target `functional-tests` has been removed and replaced with `full-coverage-tests`. The difference being that it will also run the unit tests and report coverage that uses the results from all of the tests, unit, functional, and documentation tests while using an install that has come a the built distribution. This code is also now used in the CI pipeline so that the coverage results are more representative.
3131
- GPU functional testing - this is done through the script `tests/docker_gpu_run_script.sh` and the docker image `tests/gpu-docker.dockerfile`
32-
- `.github/workflows/publish.yml` - A publishing specific workflow, that publishes the python package to PYPI through OpenID Connect (OIDC). The python package used to be published in the `ci.yml` workflow using tokens, this has now been removed in favour of using the more secure OIDC method.
32+
- `.github/workflows/publish.yml` - A publishing specific workflow, that publishes the python package to PYPI through OpenID Connect (OIDC). The python package used to be published in the `ci.yml` workflow using tokens, this has now been removed in favour of using the more secure OIDC method.
33+
- Dev-container image build and publish GitHub action workflow to pre-build the dev container to reduce the time required for starting to develop using dev containers. The workflow can be found at: `./.github/workflows/devcontainer_build_and_publish.yml`.
3334

3435
### Changed
3536

0 commit comments

Comments
 (0)