Skip to content

Commit 38ad07c

Browse files
committed
move from travis-ci to github actions and retired codeclimate
1 parent 2e1e12d commit 38ad07c

File tree

4 files changed

+112
-17
lines changed

4 files changed

+112
-17
lines changed

.codeclimate.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: CI
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-20.04
10+
timeout-minutes: 480
11+
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
platform: [unix, os4, os3, mos, aros-ppc, aros-i386, aros-x86_64, mingw32]
16+
build: [release, debug]
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- name: setup dependencies
22+
run: |
23+
sudo dpkg --add-architecture i386
24+
sudo apt-get update -y -qq || true
25+
sudo apt-get -qq install libc6:i386
26+
sudo ln -s /usr/lib/x86_64-linux-gnu/libmpfr.so.6 /usr/lib/x86_64-linux-gnu/libmpfr.so.4
27+
28+
- name: setup env
29+
run : |
30+
echo "GITHUB_SHA7=$(echo ${GITHUB_SHA::7})" >>$GITHUB_ENV
31+
32+
- name: install adtools build env
33+
run: |
34+
DOWNLOAD_PATH=https://github.com/adtools/adtools/releases/download/20170213
35+
curl -L ${DOWNLOAD_PATH}/adtools-utils.tar.bz2 | sudo tar xj -C /
36+
if [[ ${{ matrix.platform }} =~ os3 ]]; then curl -L ${DOWNLOAD_PATH}/adtools-m68k-amigaos.tar.bz2 | sudo tar xj -C / ; fi
37+
if [[ ${{ matrix.platform }} =~ os4 ]]; then curl -L ${DOWNLOAD_PATH}/adtools-ppc-amigaos.tar.bz2 | sudo tar xj -C / ; fi
38+
if [[ ${{ matrix.platform }} =~ mos ]]; then curl -L ${DOWNLOAD_PATH}/adtools-ppc-morphos.tar.bz2 | sudo tar xj -C / ; fi
39+
if [[ ${{ matrix.platform }} =~ aros-ppc ]]; then curl -L ${DOWNLOAD_PATH}/adtools-ppc-aros.tar.bz2 | sudo tar xj -C / ; fi
40+
if [[ ${{ matrix.platform }} =~ aros-i386 ]]; then curl -L ${DOWNLOAD_PATH}/adtools-i386-aros.tar.bz2 | sudo tar xj -C / ; fi
41+
if [[ ${{ matrix.platform }} =~ aros-x86_64 ]]; then curl -L ${DOWNLOAD_PATH}/adtools-x86_64-aros.tar.bz2 | sudo tar xj -C / ; fi
42+
if [[ ${{ matrix.platform }} =~ mingw32 ]]; then sudo apt-get -qq install binutils-mingw-w64-i686 gcc-mingw-w64-i686; fi
43+
44+
- name: cleanup old action artifacts
45+
run: .github/workflows/purge_artifacts.sh ${{ secrets.GITHUB_TOKEN }}
46+
47+
#- name: remote debug tmate session
48+
# uses: mxschmitt/action-tmate@v1
49+
# if: matrix.platform == 'os4'
50+
51+
- name: build [${{ matrix.platform }}, ${{ matrix.build }}]
52+
timeout-minutes: 480
53+
run: |
54+
export PATH=/usr/local/amiga/bin:/opt/m68k-amigaos/bin:/opt/ppc-amigaos/bin:/opt/ppc-morphos/bin:${PATH}
55+
if [[ ${{ matrix.build }} =~ release ]]; then make -j1 OS=${{ matrix.platform }} DEBUG= ; fi
56+
if [[ ${{ matrix.build }} =~ debug ]]; then make -j1 OS=${{ matrix.platform }} ; fi

.github/workflows/purge_artifacts.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env bash
2+
3+
# Customize those three lines with your repository and credentials:
4+
REPO=https://api.github.com/repos/${GITHUB_REPOSITORY}
5+
GITHUB_USER=${GITHUB_REPOSITORY%%/*}
6+
GITHUB_TOKEN=${1}
7+
8+
# Number of most recent versions to keep for each artifact:
9+
KEEP=4
10+
11+
# A shortcut to call GitHub API.
12+
ghapi() { curl --silent --location --user $GITHUB_USER:$GITHUB_TOKEN "$@"; }
13+
14+
# A temporary file which receives HTTP response headers.
15+
TMPFILE=/tmp/tmp.$$
16+
17+
# An associative array, key: artifact name, value: number of artifacts of that name.
18+
declare -A ARTCOUNT
19+
20+
# Process all artifacts on this repository, loop on returned "pages".
21+
URL=$REPO/actions/artifacts
22+
while [[ -n "$URL" ]]; do
23+
24+
# Get current page, get response headers in a temporary file.
25+
JSON=$(ghapi --dump-header $TMPFILE "$URL")
26+
27+
# Get URL of next page. Will be empty if we are at the last page.
28+
URL=$(grep '^Link:' "$TMPFILE" | tr ',' '\n' | grep 'rel="next"' | head -1 | sed -e 's/.*<//' -e 's/>.*//')
29+
rm -f ${TMPFILE}
30+
31+
# Number of artifacts on this page:
32+
COUNT=$(( $(jq <<<$JSON -r '.artifacts | length') ))
33+
34+
# Loop on all artifacts on this page.
35+
for ((i=0; $i < $COUNT; i++)); do
36+
37+
# Get name of artifact and count instances of this name.
38+
STR=$(jq <<<$JSON -r ".artifacts[$i].name?")
39+
name=${STR%%-*}-${STR##*-}
40+
ARTCOUNT[$name]=$(( $(( ${ARTCOUNT[$name]} )) + 1))
41+
42+
printf "Found '%s' #%d, " $STR ${ARTCOUNT[$name]}
43+
# Check if we must delete this one.
44+
if [[ ${ARTCOUNT[$name]} -gt $KEEP ]]; then
45+
id=$(jq <<<$JSON -r ".artifacts[$i].id?")
46+
size=$(( $(jq <<<$JSON -r ".artifacts[$i].size_in_bytes?") ))
47+
printf "deleting %d bytes\n" $size
48+
ghapi -X DELETE $REPO/actions/artifacts/$id
49+
else
50+
printf "OK\n"
51+
fi
52+
done
53+
done
54+
55+
exit 0

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# FlexCat (Flexible Catalogs for Amiga systems)
22

3-
[![Build Status](https://travis-ci.org/adtools/flexcat.svg?branch=master)](https://travis-ci.org/adtools/flexcat)
4-
[![Code Climate](https://codeclimate.com/github/adtools/flexcat/badges/gpa.svg)](https://codeclimate.com/github/adtools/flexcat)
3+
[![Build](https://github.com/adtools/flexcat/workflows/CI/badge.svg)](https://github.com/adtools/flexcat/actions)
54
[![License](http://img.shields.io/:license-gpl2-blue.svg?style=flat)](http://www.gnu.org/licenses/gpl-2.0.html)
6-
[![Github Issues](http://githubbadges.herokuapp.com/adtools/flexcat/issues.svg)](https://github.com/adtools/flexcat/issues)
75

86
FlexCat is a tool to create Amiga localization catalogs (*.catalog files) similar to what the good-old CatComp tool does. However, it can also create source and header files for developers and can be used on other platforms (Unix, Windows, etc.), thus is cross-platform aware. The difference between FlexCat and KitCat, CatComp and some others is, that FlexCat is designed to produce any source you want: any programming language, any individual needs should be satisfied. However, FlexCat is not more difficult to use. This sounds like a contradiction. FlexCat's solution is to use template files, the so called "source descriptions". Ready to use examples for Assembler, C, C++, E, Oberon and Modula-2 are distributed, additionally an example for supporting catalogs on Workbench 2.0. Any other examples are welcome.
97

0 commit comments

Comments
 (0)