Skip to content

Commit 26b04c8

Browse files
authored
Build python 3.9 and switch to GitHub Actions (#3)
1 parent eee339f commit 26b04c8

File tree

3 files changed

+34
-29
lines changed

3 files changed

+34
-29
lines changed

.github/workflows/build.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: build
2+
on: [push, pull_request]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
matrix:
8+
python-version: [ 3.6.12, 3.7.9, 3.8.6, 3.9.0 ]
9+
arch: [ amd64, aarch64 ]
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Setup QEMU
13+
if: matrix.arch != 'amd64'
14+
uses: docker/setup-qemu-action@v1
15+
with:
16+
platforms: all
17+
- name: Setup Docker buildx
18+
if: matrix.arch != 'amd64'
19+
uses: docker/setup-buildx-action@v1
20+
with:
21+
install: true
22+
- name: Download docker image
23+
run: docker pull dmoj/runtimes-tier1:${{ matrix.arch }}-latest
24+
- name: Build python
25+
run: |
26+
PYTHON_DIR="python$(echo "${{ matrix.python-version }}" | cut -d. -f 1-2)"
27+
PYTHON_URL="https://www.python.org/ftp/python/$(perl -e 'shift=~/([\d.]+)/;print$1' "${{ matrix.python-version }}")/Python-${{ matrix.python-version }}.tar.xz"
28+
docker run -e ARCH="${{ matrix.arch }}" -e PYTHON_DIR="$PYTHON_DIR" -e PYTHON_URL="$PYTHON_URL" -v "$(pwd):/code" dmoj/runtimes-tier1:${{ matrix.arch }}-latest
29+
- name: Archive build artifacts
30+
uses: actions/upload-artifact@v2
31+
with:
32+
name: Python ${{ matrix.python-version }} (${{ matrix.arch }})
33+
path: python*.tar.gz

.travis.yml

-28
This file was deleted.

run

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ mkdir "$PYTHON_DIR"
77
echo "Downloading $PYTHON_URL to $PYTHON_DIR..."
88
curl -L "$PYTHON_URL" | tar -xJ -C "$PYTHON_DIR" --strip-components=1
99
cd "$PYTHON_DIR"
10-
./configure --prefix=/code/"$PYTHON_DIR" --enable-optimizations
10+
./configure --prefix=/code/"$PYTHON_DIR" $(if [ "$ARCH" = amd64 -a "$(echo "$PYTHON_DIR" | cut -d. -f2)" -ge 8 ]; then echo --enable-optimizations; fi)
1111
make -j"$(nproc)"
1212
make install
1313
cd /code && tar czvf "$PYTHON_DIR-$ARCH.tar.gz" "$PYTHON_DIR"

0 commit comments

Comments
 (0)