Skip to content

Commit bdeddfa

Browse files
authored
Fix #42 (#55)
* Fix --arch-name * Use ubuntu 24.04 * Version bump
1 parent 64e40e2 commit bdeddfa

6 files changed

Lines changed: 82 additions & 9 deletions

File tree

.github/workflows/build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions: read-all
1010
jobs:
1111
format:
1212
name: Check formatting
13-
runs-on: ubuntu-20.04
13+
runs-on: ubuntu-24.04
1414
strategy:
1515
fail-fast: false
1616
matrix:
@@ -27,7 +27,7 @@ jobs:
2727
run: make format
2828
lint:
2929
name: Check for erroneous constructs
30-
runs-on: ubuntu-20.04
30+
runs-on: ubuntu-24.04
3131
strategy:
3232
fail-fast: false
3333
matrix:
@@ -44,7 +44,7 @@ jobs:
4444
run: make lint
4545
links:
4646
name: Check Markdown links
47-
runs-on: ubuntu-20.04
47+
runs-on: ubuntu-24.04
4848
steps:
4949
- name: Checkout the Git repository
5050
uses: actions/checkout@v4
@@ -58,7 +58,7 @@ jobs:
5858
make links
5959
test:
6060
name: Run tests
61-
runs-on: ubuntu-20.04
61+
runs-on: ubuntu-24.04
6262
strategy:
6363
fail-fast: false
6464
matrix:
@@ -75,7 +75,7 @@ jobs:
7575
run: make test
7676
build:
7777
name: Make pip packages
78-
runs-on: ubuntu-20.04
78+
runs-on: ubuntu-24.04
7979
needs: [format, lint, test]
8080
steps:
8181
- name: Checkout the Git repository
@@ -94,7 +94,7 @@ jobs:
9494
if-no-files-found: error
9595
standalone:
9696
name: Make Standalone
97-
runs-on: ubuntu-20.04
97+
runs-on: ubuntu-24.04
9898
needs: [format, lint, test]
9999
steps:
100100
- name: Checkout the Git repository
@@ -115,7 +115,7 @@ jobs:
115115
if-no-files-found: error
116116
publish:
117117
name: Publish to PyPi
118-
runs-on: ubuntu-20.04
118+
runs-on: ubuntu-24.04
119119
needs: [build, links]
120120
if: github.repository == 'toltec-dev/build' && github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
121121
permissions:

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ standalone: .venv-build/bin/activate
5858

5959
test: .venv-runtime/bin/activate
6060
. .venv-runtime/bin/activate; \
61-
python -m unittest
61+
python -m unittest; \
62+
tests/foobar/test.sh
6263

6364
format: .venv-build/bin/activate
6465
. .venv-build/bin/activate; \

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "toltecmk"
3-
version = "0.3.3"
3+
version = "0.3.4"
44
authors = [
55
{ name="Mattéo Delabre", email="git.matteo@delab.re" },
66
{ name="Eeems", email="eeems@eeems.email" },

tests/foobar/package

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2023 The Toltec Contributors
3+
# SPDX-License-Identifier: MIT
4+
5+
archs=(rm1 rm2 rmall)
6+
pkgnames=(foo bar)
7+
url=https://toltec-dev.org/
8+
pkgver=0.0.0-1
9+
timestamp=2023-12-23T20:46:51Z
10+
section="utils"
11+
maintainer="Eeems <eeems@eeems.email>"
12+
license=MIT
13+
image=base:v3.1
14+
source=()
15+
sha256sums=()
16+
17+
build() {
18+
true
19+
}
20+
21+
foo() {
22+
pkgdesc="Foo"
23+
package() {
24+
true
25+
}
26+
}
27+
bar() {
28+
pkgdesc="Bar"
29+
package() {
30+
true
31+
}
32+
}
33+

tests/foobar/test.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
set -e
3+
4+
exists() {
5+
if ! [ -f "$1" ]; then
6+
echo "Error: Missing ${1}"
7+
return 1
8+
fi
9+
}
10+
missing() {
11+
if [ -f "$1" ]; then
12+
echo "Error: Found ${1}"
13+
return 1
14+
fi
15+
}
16+
17+
tmpdir=$(mktemp -d)
18+
cleanup(){
19+
rm -rf "$tmpdir"
20+
}
21+
trap cleanup EXIT
22+
23+
python -m toltec \
24+
--verbose \
25+
--work-dir "$tmpdir/work" \
26+
--dist-dir "$tmpdir/dist" \
27+
--arch-name rmall \
28+
$(dirname $0)
29+
30+
tree $tmpdir/dist
31+
exists $tmpdir/dist/rmall/foo_0.0.0-1_rmall.ipk
32+
missing $tmpdir/dist/rm1/foo_0.0.0-1_rm1.ipk
33+
missing $tmpdir/dist/rm2/foo_0.0.0-1_rm2.ipk
34+
exists $tmpdir/dist/rmall/bar_0.0.0-1_rmall.ipk
35+
missing $tmpdir/dist/rm1/bar_0.0.0-1_rm1.ipk
36+
missing $tmpdir/dist/rm2/bar_0.0.0-1_rm2.ipk

toltec/__main__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ def main() -> int: # pylint:disable=too-many-branches
103103
build_matrix = {}
104104

105105
for arch, recipes in recipe_bundle.items():
106+
if args.arch_name and arch not in args.arch_name:
107+
continue
108+
106109
if args.package_name:
107110
build_matrix[arch] = [
108111
recipes.packages[pkg_name]

0 commit comments

Comments
 (0)