-
-
Notifications
You must be signed in to change notification settings - Fork 312
132 lines (122 loc) · 4.74 KB
/
selfie.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Make Everything Selfie
on:
push:
paths-ignore:
- '**.md'
- '**.txt'
- 'docs'
- 'AUTHORS'
- 'LICENSE'
pull_request:
paths-ignore:
- '**.md'
- '**.txt'
- 'docs'
- 'AUTHORS'
- 'LICENSE'
schedule:
# trigger fridays at 12am
- cron: '0 0 * * 5'
workflow_dispatch:
inputs:
oslinux:
description: 'Make all on Linux'
type: boolean
required: true
default: true
osmacos:
description: 'Make all on macOS'
type: boolean
required: true
default: true
oswindows:
description: 'Make all on Windows'
type: boolean
required: true
default: true
rundocker:
description: 'Make everything on docker'
type: boolean
required: true
default: true
jobs:
make-all-on-linux:
name: Make all of selfie on Linux
runs-on: ubuntu-latest
if: ${{ ((github.event_name != 'workflow_dispatch') || (github.event.inputs.oslinux == 'true')) && (((!github.event.repository.private) || ((github.ref == 'refs/heads/main') && (github.event_name != 'schedule'))) || (github.event_name == 'workflow_dispatch')) }}
steps:
- name: Checkout selfie
uses: actions/checkout@v4
- name: Make all
run: make -j -O all
- name: Use Python 3.12.x
uses: actions/setup-python@v5
with:
python-version: "3.12.x"
- name: Run autograder baseline
run: make grade
make-all-on-macos:
name: Make all of selfie on macOS
runs-on: macos-latest
if: ${{ ((github.event_name != 'workflow_dispatch') || (github.event.inputs.osmacos == 'true')) && ((!github.event.repository.private) || (github.event_name == 'workflow_dispatch')) }}
steps:
- name: Checkout selfie
uses: actions/checkout@v4
- name: Make all
run: make -j all
- name: Use Python 3.12.x
uses: actions/setup-python@v5
with:
python-version: "3.12.x"
- name: Run autograder baseline
run: make grade
make-all-on-windows:
name: Make all of selfie on Windows
runs-on: windows-latest
if: ${{ ((github.event_name != 'workflow_dispatch') || (github.event.inputs.oswindows == 'true')) && ((!github.event.repository.private) || (github.event_name == 'workflow_dispatch')) }}
steps:
- name: Checkout selfie
uses: actions/checkout@v4
- name: Use gcc from cygwin for LP64 data model (not LLP64 with mingw)
run: |
choco upgrade cygwin -y --no-progress
C:\tools\cygwin\cygwinsetup.exe -q -d -N -R C:\tools\cygwin -l C:\tools\cygwin\packages -P gcc-core,make | Out-Default
echo 'C:\tools\cygwin\bin' >> $env:GITHUB_PATH
- name: Make all
run: make -j -O all
# TODO: python3 does not work here
make-everything-on-docker:
name: Make everything of selfie on docker
runs-on: ubuntu-latest
if: ${{ ((github.event_name != 'workflow_dispatch') || (github.event.inputs.rundocker == 'true')) && (((!github.event.repository.private) || ((github.ref == 'refs/heads/main') && (github.event_name != 'schedule'))) || (github.event_name == 'workflow_dispatch')) }}
# usage: optional run argument --platform=linux/amd64 or --platform=linux/arm64
#
# - pull docker images: docker pull -a cksystemsteaching/selfie
# - run command: docker run -v cksystemsteaching/selfie command
# - run interactive: docker run -it cksystemsteaching/selfie
# - run on my selfie: docker run -it -v /myselfie:/opt/myselfie cksystemsteaching/selfie
steps:
- name: Checkout selfie
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Build docker images
run: |
# TODO: build single multi-platform image even though arm64 does not support 32-bit tools
docker buildx build --platform=linux/arm64 --target=selfieall --load -t cksystemsteaching/selfie:arm64 .
docker buildx build --platform=linux/amd64 --target=selfieeverything --load -t cksystemsteaching/selfie:amd64 -t cksystemsteaching/selfie:latest .
- name: Make everything
run: |
# TODO: emulated arm64 "make -j -O all", too slow for now, skipping
docker run cksystemsteaching/selfie:amd64 make -j -O everything
docker run cksystemsteaching/selfie:latest make pythons
- name: Deploy docker image
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'cksystemsteaching/selfie' }}
run: |
echo '${{ secrets.DOCKERHUB_PASSWORD }}' | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
docker push -a cksystemsteaching/selfie