Skip to content

Commit

Permalink
install linux pre-reqs (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Dec 22, 2022
1 parent a03db93 commit 3d4b576
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 8 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci-pre-reqs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
on:
workflow_call:
pull_request:
paths:
- pre-reqs.ts
- .github/workflows/ci-pre-reqs.yml

concurrency:
group: ${{ github.ref }}/2
cancel-in-progress: true

jobs:
pre-reqs:
continue-on-error: true
runs-on: ubuntu-latest
strategy:
matrix:
container:
- debian:buster-slim
- debian:bullseye-slim
- debian:bookworm-slim
- archlinux:latest
# - ubuntu:bionic glibc too old
- ubuntu:focal
- ubuntu:jammy
- ubuntu:kinetic
# - ubuntu:lunar glibc too old
# - ubuntu:trusty
# - ubuntu:xenial glibc too old
- fedora:latest
# - nixos/nix:latest can’t exec
# - alpine:latest tea binary doesn’t actually end up on the system (wtf)
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v3
- uses: ./
- run: sh -x ./install-pre-reqs.sh
- run: tea -X node -e 'console.log(1)'
8 changes: 1 addition & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_call:

concurrency:
group: ${{ github.ref }}
group: ${{ github.ref }}/1
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -75,12 +75,6 @@ jobs:
steps:
- uses: actions/checkout@v3

# required for somethings
- run: |
apt-get update
apt-get --yes install libc-dev libstdc++-8-dev libgcc-8-dev
if: ${{ matrix.container != '' }}
- uses: ./
id: tea
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

# GitHub Action 0.7.2
# GitHub Action 0.8.0

This repository also provides the `tea` GitHub Action.

Expand Down
9 changes: 9 additions & 0 deletions action.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ async function go() {
//TODO a flag so it returns 0 so we can not just swallow all errors lol
}

if (os.platform() != 'darwin') {
const sh = path.join(path.dirname(__filename), "install-pre-reqs.sh")
if (process.getuid() == 0) {
execSync(sh)
} else {
execSync(`sudo ${sh}`)
}
}

const target = process.env['INPUT_TARGET']
if (target) {
execSync(`${teafile} ${target}`, {stdio: "inherit", env})
Expand Down
20 changes: 20 additions & 0 deletions install-pre-reqs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
# installs linux pre-reqs with the system packager
# PR your system!

if test -f /etc/debian_version; then
apt-get --yes update

case $(cat /etc/debian_version) in
jessie/sid|8.*|stretch/sid|9.*)
apt-get --yes install libc-dev libstdc++-4.8-dev libgcc-4.7-dev;;
buster/sid|10.*)
apt-get --yes install libc-dev libstdc++-8-dev libgcc-8-dev;;
bullseye/sid|11.*)
apt-get --yes install libc-dev libstdc++-10-dev libgcc-9-dev;;
bookworm/sid|12.*|*)
apt-get --yes install libc-dev libstdc++-11-dev libgcc-10-dev;;
esac
elif test -f /etc/fedora-release; then
yum --assumeyes install libatomic
fi

0 comments on commit 3d4b576

Please sign in to comment.