Skip to content

Commit

Permalink
Start using Github Actions, remove Travis support.
Browse files Browse the repository at this point in the history
  • Loading branch information
foxik committed Feb 16, 2023
1 parent 8f5879c commit c2c1256
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 50 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ascii_only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: ASCII test

on: push

jobs:
ascii_only:
name: ASCII test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Test that sources are ASCII only
run: python3 tests/ascii_only.py
62 changes: 62 additions & 0 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Compile

on: push

jobs:
compile:
name: Compile
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
platform: linux-gcc CXX=g++-9
- os: ubuntu-22.04
platform: linux-gcc CXX=g++-10
- os: ubuntu-22.04
platform: linux-gcc CXX=g++-11
- os: ubuntu-22.04
platform: linux-gcc
container: quay.io/pypa/manylinux2014_x86_64
- os: ubuntu-22.04
platform: linux-clang CXX=clang++-12
- os: ubuntu-22.04
platform: linux-clang CXX=clang++-13
- os: ubuntu-22.04
platform: linux-clang CXX=clang++-14
- os: windows-2019
platform: win-vs-32
- os: windows-2019
platform: win-vs-64
- os: windows-2022
platform: win-vs-32
- os: windows-2022
platform: win-vs-64
- os: macos-11
platform: macos-clang-64
- os: macos-11
platform: macos-clang-arm64

steps:
- uses: actions/checkout@v3

- if: startsWith(matrix.os, 'windows')
name: Windows - Set up MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ endswith(matrix.platform, '-32') && 'x86' || 'x64' }}

- if: startsWith(matrix.os, 'windows')
name: Windows - Install make
run: choco install --no-progress -y make

- name: Compile src
run: make PLATFORM=${{ matrix.platform }} -k -C src full
env:
C_FLAGS: $(treat_warnings_as_errors)

- name: Compile tests
run: make PLATFORM=${{ matrix.platform }} -k -C tests all
if: matrix.platform != 'macos-clang-arm64'
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

21 changes: 0 additions & 21 deletions tests/ascii_only.pl

This file was deleted.

22 changes: 22 additions & 0 deletions tests/ascii_only.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python3
import argparse
import glob
import os
import sys

if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("root", default="", nargs="?", type=str, help="Root directory to check")
args = parser.parse_args()

nonascii = False
for path in glob.iglob(os.path.join(args.root, "**"), recursive=True):
if path.endswith((".c", ".cpp", ".h", ".i")) or "Makefile" in path:
try:
with open(path, "r", encoding="ascii") as path_file:
path_file.read()
except:
print("Non-ascii characters in {}".format(path), flush=True)
nonascii = True

sys.exit(1 if nonascii else 0)

0 comments on commit c2c1256

Please sign in to comment.