Skip to content

Commit 2526359

Browse files
authored
Fix github actions (#9)
* Fix up github actions with singularity
1 parent c08ea36 commit 2526359

File tree

9 files changed

+211
-21
lines changed

9 files changed

+211
-21
lines changed

.github/workflows/pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: actions/cache@v3
2828
with:
2929
path: .singularity/image.sif
30-
key: ${{ hashFiles('container.def') }}
30+
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
3131
- name: Get gems and node files from cache
3232
id: cache-bundle-npm
3333
uses: actions/cache@v3

.github/workflows/regress.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ jobs:
1212
uses: actions/checkout@v4
1313
- name: Setup apptainer
1414
uses: eWaterCycle/setup-apptainer@v2.0.0
15-
- name: Read container tag
16-
run: echo "CONTAINER_TAG=$(cat bin/.container-tag)" >> $GITHUB_ENV
1715
- name: Get container from cache
1816
id: cache-sif
1917
uses: actions/cache@v3
2018
with:
21-
path: .singularity/image${{ env.CONTAINER_TAG }}.sif
19+
path: .singularity/image.sif
2220
key: ${{ hashFiles('container.def', 'bin/.container-tag') }}
2321
- name: Get gems and node files from cache
2422
id: cache-bundle-npm

arch/ext/B.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ B:
2121
implies:
2222
- [Zba, 1.0]
2323
- [Zbb, 1.0]
24-
- [Zbc, 1.0]
24+
- [Zbs, 1.0]
2525
description: |
2626
The B standard extension comprises instructions provided by the `Zba`, `Zbb`, and `Zbs` extensions.
2727

arch/ext/Zba.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,45 @@ Zba:
1717
of wider elements. The `slli.uw` -- added in this extension -- can be used when the index is to
1818
be interpreted as an unsigned word.
1919
type: unprivileged
20+
company:
21+
name: RISC-V International
22+
url: https://riscv.org
2023
versions:
2124
- version: 1.0
2225
state: ratified
2326
ratification_date: 2021-06
27+
repositories:
28+
- url: https://github.com/riscv/riscv-bitmanip
29+
branch: main
30+
contributors:
31+
- name: Jacob Bachmeyer
32+
- name: Allen Baum
33+
- name: Ari Ben
34+
- name: Alex Bradbury
35+
- name: Steven Brager
36+
- name: Rogier Brussee
37+
- name: Michael Clark
38+
- name: Ken Dockser
39+
- name: Paul Donahue
40+
- name: Dennis Ferguson
41+
- name: Fabian Giesen
42+
- name: John Hauser
43+
- name: Robert Henry
44+
- name: Bruce Holt
45+
- name: Po-wei Huang
46+
- name: Ben Marshall
47+
- name: Rex McCrary
48+
- name: Lee Moore
49+
- name: Jiri Moravec
50+
- name: Samuel Neves
51+
- name: Markus Oberhumer
52+
- name: Christopher Olson
53+
- name: Nils Pipenbrinck
54+
- name: Joseph Rahmeh
55+
- name: Xue Saw
56+
- name: Tommy Thorn
57+
- name: Philipp Tomsich
58+
- name: Avishai Tvila
59+
- name: Andrew Waterman
60+
- name: Thomas Wicki
61+
- name: Claire Wolf

arch/ext/Zbb.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,45 @@ Zbb:
55
description: |
66
Basic bit manipulation
77
type: unprivileged
8+
company:
9+
name: RISC-V International
10+
url: https://riscv.org
811
versions:
912
- version: 1.0
1013
state: ratified
1114
ratification_date: 2021-06
15+
repositories:
16+
- url: https://github.com/riscv/riscv-bitmanip
17+
branch: main
18+
contributors:
19+
- name: Jacob Bachmeyer
20+
- name: Allen Baum
21+
- name: Ari Ben
22+
- name: Alex Bradbury
23+
- name: Steven Brager
24+
- name: Rogier Brussee
25+
- name: Michael Clark
26+
- name: Ken Dockser
27+
- name: Paul Donahue
28+
- name: Dennis Ferguson
29+
- name: Fabian Giesen
30+
- name: John Hauser
31+
- name: Robert Henry
32+
- name: Bruce Holt
33+
- name: Po-wei Huang
34+
- name: Ben Marshall
35+
- name: Rex McCrary
36+
- name: Lee Moore
37+
- name: Jiri Moravec
38+
- name: Samuel Neves
39+
- name: Markus Oberhumer
40+
- name: Christopher Olson
41+
- name: Nils Pipenbrinck
42+
- name: Joseph Rahmeh
43+
- name: Xue Saw
44+
- name: Tommy Thorn
45+
- name: Philipp Tomsich
46+
- name: Avishai Tvila
47+
- name: Andrew Waterman
48+
- name: Thomas Wicki
49+
- name: Claire Wolf

arch/ext/Zbc.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,47 @@ Zbc:
55
description: |
66
Carry-less multiplication is the multiplication in the polynomial ring over GF(2).
77
type: unprivileged
8+
company:
9+
name: RISC-V International
10+
url: https://riscv.org
811
versions:
912
- version: 1.0
1013
state: ratified
1114
ratification_date: 2021-06
15+
repositories:
16+
- url: https://github.com/riscv/riscv-bitmanip
17+
branch: main
18+
contributors:
19+
- name: Jacob Bachmeyer
20+
- name: Allen Baum
21+
- name: Ari Ben
22+
- name: Alex Bradbury
23+
- name: Steven Brager
24+
- name: Rogier Brussee
25+
- name: Michael Clark
26+
- name: Ken Dockser
27+
- name: Paul Donahue
28+
- name: Dennis Ferguson
29+
- name: Fabian Giesen
30+
- name: John Hauser
31+
- name: Robert Henry
32+
- name: Bruce Holt
33+
- name: Po-wei Huang
34+
- name: Ben Marshall
35+
- name: Rex McCrary
36+
- name: Lee Moore
37+
- name: Jiri Moravec
38+
- name: Samuel Neves
39+
- name: Markus Oberhumer
40+
- name: Christopher Olson
41+
- name: Nils Pipenbrinck
42+
- name: Joseph Rahmeh
43+
- name: Xue Saw
44+
- name: Tommy Thorn
45+
- name: Philipp Tomsich
46+
- name: Avishai Tvila
47+
- name: Andrew Waterman
48+
- name: Thomas Wicki
49+
- name: Claire Wolf
50+
51+

arch/ext/Zbs.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# yaml-language-server: $schema=../../schemas/ext_schema.json
2+
3+
Zbs:
4+
long_name: Single-bit instructions
5+
description: |
6+
The single-bit instructions provide a mechanism to set, clear, invert, or extract a single bit
7+
in a register. The bit is specified by its index
8+
type: unprivileged
9+
company:
10+
name: RISC-V International
11+
url: https://riscv.org
12+
versions:
13+
- version: 1.0
14+
state: ratified
15+
ratification_date: 2021-06
16+
repositories:
17+
- url: https://github.com/riscv/riscv-bitmanip
18+
branch: main
19+
contributors:
20+
- name: Jacob Bachmeyer
21+
- name: Allen Baum
22+
- name: Ari Ben
23+
- name: Alex Bradbury
24+
- name: Steven Brager
25+
- name: Rogier Brussee
26+
- name: Michael Clark
27+
- name: Ken Dockser
28+
- name: Paul Donahue
29+
- name: Dennis Ferguson
30+
- name: Fabian Giesen
31+
- name: John Hauser
32+
- name: Robert Henry
33+
- name: Bruce Holt
34+
- name: Po-wei Huang
35+
- name: Ben Marshall
36+
- name: Rex McCrary
37+
- name: Lee Moore
38+
- name: Jiri Moravec
39+
- name: Samuel Neves
40+
- name: Markus Oberhumer
41+
- name: Christopher Olson
42+
- name: Nils Pipenbrinck
43+
- name: Joseph Rahmeh
44+
- name: Xue Saw
45+
- name: Tommy Thorn
46+
- name: Philipp Tomsich
47+
- name: Avishai Tvila
48+
- name: Andrew Waterman
49+
- name: Thomas Wicki
50+
- name: Claire Wolf
51+
52+

bin/build_container

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ ROOT=$(realpath $(dirname $(dirname $BASH_SOURCE[0])))
44

55
CONTAINER_TAG=`cat ${ROOT}/bin/.container-tag`
66

7+
if [ -v GITHUB_ACTIONS ]; then
8+
echo "ACTIONS"
9+
CONTAINER_PATH=${ROOT}/.singularity/image.sif
10+
HOME_PATH=${GITHUB_WORKSPACE}
11+
SINGULARITY_CACHE=--disable-cache
12+
else
13+
CONTAINER_PATH=${ROOT}/.singularity/image-$CONTAINER_TAG.sif
14+
HOME_PATH=${HOME}
15+
SINGULARITY_CACHE=
16+
fi
17+
718
# uncomment below if you have sudo permission and don't have fakeroot permission
819
NEED_SUDO=0
920
cat /etc/subgid | grep "^$(id -u):"
@@ -54,13 +65,13 @@ echo "Building container..."
5465
if [ ! -d "${ROOT}/.singularity" ]; then
5566
mkdir -p ${ROOT}/.singularity
5667
fi
57-
if [ -e "${ROOT}/.singularity/image.sif" ]; then
58-
rm -f "${ROOT}/.singularity/image.sif"
68+
if [ -e ${CONTAINER_PATH} ]; then
69+
rm -f ${CONTAINER_PATH}
5970
fi
6071

6172
$SUDO singularity build --force \
6273
$FAKEROOT \
63-
${ROOT}/.singularity/image-${CONTAINER_TAG}.sif \
74+
${CONTAINER_PATH} \
6475
${ROOT}/container.def
6576
if [ $? -ne 0 ]; then
6677
echo "Container build failed." 2>&1

bin/setup

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,43 @@ cd $ROOT
66

77
CONTAINER_TAG=`cat ${ROOT}/bin/.container-tag`
88

9+
if [ -v GITHUB_ACTIONS ]; then
10+
echo "ACTIONS"
11+
CONTAINER_PATH=${ROOT}/.singularity/image.sif
12+
HOME_PATH=${GITHUB_WORKSPACE}
13+
HOME_OPT="--home ${ROOT}/.home"
14+
SINGULARITY_CACHE=--disable-cache
15+
else
16+
CONTAINER_PATH=${ROOT}/.singularity/image-$CONTAINER_TAG.sif
17+
HOME_PATH=${HOME}
18+
HOME_OPT="--bind ${ROOT}/.home:${HOME_PATH}"
19+
SINGULARITY_CACHE=
20+
fi
21+
922
if [ ! -d $ROOT/.home ]; then
1023
mkdir $ROOT/.home
1124
fi
1225

13-
if [ ! -f $ROOT/.singularity/image-$CONTAINER_TAG.sif ]; then
26+
if [ ! -f ${CONTAINER_PATH} ]; then
1427
echo "Fetching container..."
1528
if [ ! -d "${ROOT}/.singularity" ]; then
1629
mkdir -p ${ROOT}/.singularity
1730
fi
18-
singularity pull --disable-cache ${ROOT}/.singularity/image-$CONTAINER_TAG.sif oras://docker.io/riscvintl/spec-generator:$CONTAINER_TAG
31+
singularity pull ${SINGULARITY_CACHE} ${CONTAINER_PATH} oras://docker.io/riscvintl/spec-generator:$CONTAINER_TAG
1932
fi
2033

2134
if [ ! -f $ROOT/.bundle/config ]; then
2235
OLDDIR=$PWD
2336
cd $ROOT
24-
singularity run --home ${ROOT}/.home .singularity/image-$CONTAINER_TAG.sif bundle config set --local path ${ROOT}/.home/.gems
25-
singularity run --home ${ROOT}/.home .singularity/image-$CONTAINER_TAG.sif bundle config set --local cache_path ${ROOT}/.home/.cache
37+
singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle config set --local path ${ROOT}/.home/.gems
38+
singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle config set --local cache_path ${ROOT}/.home/.cache
2639
cd $OLDDIR
2740
fi
2841

2942
if [ ! -d $ROOT/.home/.gems ]; then
3043
OLDDIR=$PWD
3144
cd $ROOT
32-
singularity run --home ${ROOT}/.home .singularity/image-$CONTAINER_TAG.sif bundle install
45+
singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle install
3346
cd $OLDDIR
3447
fi
3548

@@ -39,8 +52,8 @@ fi
3952

4053
if [[ ! -z "$DEVELOPMENT" && $DEVELOPMENT -eq 1 ]]; then
4154
if [ ! -d "${ROOT}/.home/.yard/gem_index"]; then
42-
singularity run --home ${ROOT}/.home .singularity/image-$CONTAINER_TAG.sif bundle exec --gemfile ${ROOT}/Gemfile yard config --gem-install-yri
43-
singularity run --home ${ROOT}/.home .singularity/image-$CONTAINER_TAG.sif bundle exec --gemfile ${ROOT}/Gemfile yard gems
55+
singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle exec --gemfile ${ROOT}/Gemfile yard config --gem-install-yri
56+
singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle exec --gemfile ${ROOT}/Gemfile yard gems
4457
touch ${ROOT}/.stamps/dev_gems
4558
fi
4659
fi
@@ -64,11 +77,11 @@ if [[ ! -z "$VSCODE" && $VSCODE -eq 1 ]]; then
6477
fi
6578

6679
if [ ! -d ${ROOT}/node_modules ]; then
67-
singularity run --home ${PWD}/.home .singularity/image-$CONTAINER_TAG.sif npm i
80+
singularity run ${HOME_OPT} ${CONTAINER_PATH} npm i
6881
fi
6982

70-
BUNDLE="singularity run --home ${PWD}/.home .singularity/image-$CONTAINER_TAG.sif bundle"
71-
RUBY="singularity run --home ${PWD}/.home .singularity/image-$CONTAINER_TAG.sif bundle exec ruby"
72-
RAKE="singularity run --home ${PWD}/.home .singularity/image-$CONTAINER_TAG.sif bundle exec rake"
73-
NPM="singularity run --home ${PWD}/.home .singularity/image-$CONTAINER_TAG.sif npm"
74-
NPX="singularity run --home ${PWD}/.home .singularity/image-$CONTAINER_TAG.sif npx"
83+
BUNDLE="singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle"
84+
RUBY="singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle exec ruby"
85+
RAKE="singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle exec rake"
86+
NPM="singularity run ${HOME_OPT} ${CONTAINER_PATH} npm"
87+
NPX="singularity run ${HOME_OPT} ${CONTAINER_PATH} npx"

0 commit comments

Comments
 (0)