Skip to content

Commit e156aa8

Browse files
author
a.b.christie
committed
ci: Test on every commit
1 parent d8a132f commit e156aa8

File tree

3 files changed

+55
-66
lines changed

3 files changed

+55
-66
lines changed

.github/workflows/build-latest.yaml

Lines changed: 0 additions & 65 deletions
This file was deleted.

.github/workflows/test.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
name: Test
3+
4+
# Actions that take place after every commit
5+
# Here every commit is built, tagged as 'latest' and tested.
6+
#
7+
# Actions also run on a schedule - the the container is built, tested
8+
# and pushed (if the relevant secrets are set) based on
9+
# a defined schedule.
10+
11+
on:
12+
push:
13+
branches:
14+
- '*'
15+
tags:
16+
- '**'
17+
schedule:
18+
# Build every Sunday (0) at 4:45pm
19+
- cron: '45 16 * * 0'
20+
21+
jobs:
22+
source:
23+
runs-on: ubuntu-latest
24+
strategy:
25+
matrix:
26+
python-version:
27+
- "3.10"
28+
- "3.11"
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v6
32+
- name: Set up Python ${{ matrix.python-version }}
33+
uses: actions/setup-python@v6
34+
with:
35+
python-version: ${{ matrix.python-version }}
36+
- name: Lint
37+
run: |
38+
pip install -r build-requirements.txt
39+
pre-commit run --all-files
40+
- name: Test
41+
run: python -m unittest
42+
43+
image:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- name: Checkout
47+
uses: actions/checkout@v6
48+
- name: Build
49+
uses: docker/build-push-action@v6
50+
with:
51+
context: .
52+
tags: xchem/frag:latest
53+
- name: Test
54+
run: docker run xchem/frag:latest /bin/sh -c "cd /usr/local/frag && python -m unittest"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Frag
22

3-
[![build latest](https://github.com/xchem/frag/actions/workflows/build-latest.yml/badge.svg)](https://github.com/xchem/frag/actions/workflows/build-latest.yml)
3+
[![test](https://github.com/xchem/frag/actions/workflows/test.yaml/badge.svg)](https://github.com/xchem/frag/actions/workflows/test.yaml)
44
[![release](https://github.com/xchem/frag/actions/workflows/release.yaml/badge.svg)](https://github.com/xchem/frag/actions/workflows/release.yaml)
55

66
[![License](http://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat)](https://github.com/xchem/frag/blob/master/LICENSE.txt)

0 commit comments

Comments
 (0)