Skip to content

Commit d023027

Browse files
committed
install linux pre-reqs (#106)
1 parent a03db93 commit d023027

File tree

5 files changed

+68
-8
lines changed

5 files changed

+68
-8
lines changed

.github/workflows/ci-pre-reqs.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
on:
2+
pull_request:
3+
paths:
4+
- pre-reqs.ts
5+
- .github/workflows/ci-pre-reqs.yml
6+
7+
concurrency:
8+
group: ${{ github.ref }}/2
9+
cancel-in-progress: true
10+
11+
jobs:
12+
pre-reqs:
13+
continue-on-error: true
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
container:
18+
- debian:buster-slim
19+
- debian:bullseye-slim
20+
- debian:bookworm-slim
21+
- archlinux:latest
22+
# - ubuntu:bionic glibc too old
23+
- ubuntu:focal
24+
- ubuntu:jammy
25+
- ubuntu:kinetic
26+
# - ubuntu:lunar glibc too old
27+
# - ubuntu:trusty
28+
# - ubuntu:xenial glibc too old
29+
- fedora:latest
30+
# - nixos/nix:latest can’t exec
31+
# - alpine:latest tea binary doesn’t actually end up on the system (wtf)
32+
container: ${{ matrix.container }}
33+
steps:
34+
- uses: actions/checkout@v3
35+
- uses: ./
36+
- run: sh -x ./install-pre-reqs.sh
37+
- run: tea -X node -e 'console.log(1)'

.github/workflows/ci.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_call:
99

1010
concurrency:
11-
group: ${{ github.ref }}
11+
group: ${{ github.ref }}/1
1212
cancel-in-progress: true
1313

1414
jobs:
@@ -75,12 +75,6 @@ jobs:
7575
steps:
7676
- uses: actions/checkout@v3
7777

78-
# required for somethings
79-
- run: |
80-
apt-get update
81-
apt-get --yes install libc-dev libstdc++-8-dev libgcc-8-dev
82-
if: ${{ matrix.container != '' }}
83-
8478
- uses: ./
8579
id: tea
8680
with:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[`install.sh`](./install.sh) is delivered when you `curl tea.xyz`.
44

5-
# GitHub Action 0.7.2
5+
# GitHub Action 0.8.0
66

77
This repository also provides the `tea` GitHub Action.
88

action.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ async function go() {
105105
//TODO a flag so it returns 0 so we can not just swallow all errors lol
106106
}
107107

108+
if (os.platform() != 'darwin') {
109+
const sh = path.join(path.dirname(__filename), "install-pre-reqs.sh")
110+
if (process.getuid() == 0) {
111+
execSync(sh)
112+
} else {
113+
execSync(`sudo ${sh}`)
114+
}
115+
}
116+
108117
const target = process.env['INPUT_TARGET']
109118
if (target) {
110119
execSync(`${teafile} ${target}`, {stdio: "inherit", env})

install-pre-reqs.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
# installs linux pre-reqs with the system packager
3+
# PR your system!
4+
5+
if test -f /etc/debian_version; then
6+
apt-get --yes update
7+
8+
case $(cat /etc/debian_version) in
9+
jessie/sid|8.*|stretch/sid|9.*)
10+
apt-get --yes install libc-dev libstdc++-4.8-dev libgcc-4.7-dev;;
11+
buster/sid|10.*)
12+
apt-get --yes install libc-dev libstdc++-8-dev libgcc-8-dev;;
13+
bullseye/sid|11.*)
14+
apt-get --yes install libc-dev libstdc++-10-dev libgcc-9-dev;;
15+
bookworm/sid|12.*|*)
16+
apt-get --yes install libc-dev libstdc++-11-dev libgcc-10-dev;;
17+
esac
18+
elif test -f /etc/fedora-release; then
19+
yum --assumeyes install libatomic
20+
fi

0 commit comments

Comments
 (0)