Skip to content

Commit

Permalink
Build python 3.9 and switch to GitHub Actions (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
quantum5 authored Oct 5, 2020
1 parent eee339f commit 26b04c8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 29 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.6.12, 3.7.9, 3.8.6, 3.9.0 ]
arch: [ amd64, aarch64 ]
steps:
- uses: actions/checkout@v2
- name: Setup QEMU
if: matrix.arch != 'amd64'
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Setup Docker buildx
if: matrix.arch != 'amd64'
uses: docker/setup-buildx-action@v1
with:
install: true
- name: Download docker image
run: docker pull dmoj/runtimes-tier1:${{ matrix.arch }}-latest
- name: Build python
run: |
PYTHON_DIR="python$(echo "${{ matrix.python-version }}" | cut -d. -f 1-2)"
PYTHON_URL="https://www.python.org/ftp/python/$(perl -e 'shift=~/([\d.]+)/;print$1' "${{ matrix.python-version }}")/Python-${{ matrix.python-version }}.tar.xz"
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
- name: Archive build artifacts
uses: actions/upload-artifact@v2
with:
name: Python ${{ matrix.python-version }} (${{ matrix.arch }})
path: python*.tar.gz
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion run
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mkdir "$PYTHON_DIR"
echo "Downloading $PYTHON_URL to $PYTHON_DIR..."
curl -L "$PYTHON_URL" | tar -xJ -C "$PYTHON_DIR" --strip-components=1
cd "$PYTHON_DIR"
./configure --prefix=/code/"$PYTHON_DIR" --enable-optimizations
./configure --prefix=/code/"$PYTHON_DIR" $(if [ "$ARCH" = amd64 -a "$(echo "$PYTHON_DIR" | cut -d. -f2)" -ge 8 ]; then echo --enable-optimizations; fi)
make -j"$(nproc)"
make install
cd /code && tar czvf "$PYTHON_DIR-$ARCH.tar.gz" "$PYTHON_DIR"

0 comments on commit 26b04c8

Please sign in to comment.