.github/workflows/ci.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "ci"
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
- macos-14
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Build
run: make
- name: Test
run: make test
# Install cosmocc
- name: Install cosmocc
run: |
mkdir -p $HOME/cosmocc
cd $HOME/cosmocc
wget -q https://cosmo.zip/pub/cosmocc/cosmocc.zip
unzip -q cosmocc.zip
pwd
ls -l
if: matrix.os == 'ubuntu-latest'
# Add cosmocc to PATH + see https://redbean.dev/#install
- name: Add cosmocc to PATH
run: |
echo $HOME/cosmocc/bin >> $GITHUB_PATH
sudo wget -O /usr/bin/ape https://cosmo.zip/pub/cosmos/bin/ape-$(uname -m).elf
sudo chmod +x /usr/bin/ape
sudo sh -c "echo ':APE:M::MZqFpD::/usr/bin/ape:' >/proc/sys/fs/binfmt_misc/register"
sudo sh -c "echo ':APE-jart:M::jartsr::/usr/bin/ape:' >/proc/sys/fs/binfmt_misc/register"
if: matrix.os == 'ubuntu-latest'
# Generate APE binary
- name: Generate APE binary
run: |
rm hex
make ape
if: matrix.os == 'ubuntu-latest'
# Run tests with APE binary
- name: Test (APE)
run: |
make test
if: matrix.os == 'ubuntu-latest'
|