Commit Diff


commit - 95a4d68f1be158baa139a96a9cdf5861487fe37d
commit + b96ca1dd6b3682a3995ece825e0ee3ef2dc2524a
blob - /dev/null
blob + df918bdb1a5957ad7493a618cde214bb0dd98bde (mode 644)
--- /dev/null
+++ .github/workflows/check.yaml
@@ -0,0 +1,28 @@
+name: Static analysis
+
+on:
+  push:
+  pull_request:
+
+jobs:
+  static-analysis:
+    if: |
+      github.event_name == 'push' ||
+      github.event_name == 'pull_request' &&
+      github.event.pull_request.head.repo.full_name != github.repository
+
+    runs-on: ubuntu-22.04
+
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: Setup luarocks
+        run: sudo apt install -y luarocks
+
+      - run: echo $(luarocks path --lr-bin) >> $GITHUB_PATH
+
+      - name: Setup luacheck
+        run: luarocks --local install luacheck
+
+      - name: Run static analysis
+        run: luacheck .
blob - /dev/null
blob + a0ec46f19a7fc87951ed71b53381f578c6425d7c (mode 644)
--- /dev/null
+++ .github/workflows/publish.yaml
@@ -0,0 +1,44 @@
+name: Publish
+
+on:
+  push:
+    branches: [master]
+    tags: ['*']
+
+jobs:
+  publish-scm-1:
+    if: github.ref == 'refs/heads/master'
+    runs-on: ubuntu-22.04
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: Setup luarocks
+        run: sudo apt install -y luarocks
+
+      - name: Setup cjson (required for upload)
+        run: luarocks install --local lua-cjson
+
+      - name: Upload rockspec scm-1
+        run: luarocks upload --force --api-key=${{ secrets.LUAROCKS_API_KEY }} afl-lua-scm-1.rockspec
+
+  publish-tag:
+    if: startsWith(github.ref, 'refs/tags/')
+    runs-on: ubuntu-22.04
+    steps:
+      # https://github.com/luarocks/luarocks/wiki/Types-of-rocks
+      - uses: actions/checkout@v2
+
+      - name: Setup luarocks
+        run: sudo apt install -y luarocks
+
+      # Make a release.
+      - run: |
+          echo TAG=${GITHUB_REF##*/} >> $GITHUB_ENV
+          luarocks new_version --tag ${{ env.TAG }}
+          luarocks install afl-lua-${{ env.TAG }}-1.rockspec
+          luarocks pack afl-lua-${{ env.TAG }}-1.rockspec
+
+      - name: Upload .rockspec and .src.rock ${{ env.TAG }}
+        run: |
+            luarocks upload --api-key=${{ secrets.LUAROCKS_API_KEY }} afl-lua-${{ env.TAG }}-1.rockspec
+            luarocks upload --api-key=${{ secrets.LUAROCKS_API_KEY }} afl-lua-${{ env.TAG }}-1.src.rock
blob - /dev/null
blob + 7d674d821f20e2a5b1a8d2f2e62cb471e4d2d188 (mode 644)
--- /dev/null
+++ .github/workflows/test.yaml
@@ -0,0 +1,45 @@
+name: Testing
+
+on:
+  push:
+  pull_request:
+
+jobs:
+  testing:
+    if: |
+      github.event_name == 'push' ||
+      github.event_name == 'pull_request' &&
+      github.event.pull_request.head.repo.full_name != github.repository
+    strategy:
+      matrix:
+        LIBLUA:
+          - "5.4"
+          - "5.3"
+          - "5.2"
+          - "5.1"
+      fail-fast: false
+    runs-on: ubuntu-22.04
+    steps:
+      - uses: actions/checkout@master
+
+      - name: Setup packages (${{ matrix.LIBLUA }}
+        run: sudo apt install -y lua5.1 liblua5.1-0-dev
+        if: ${{ matrix.LIBLUA == '5.1' }}
+
+      - name: Setup packages (${{ matrix.LIBLUA }}
+        run: sudo apt install -y lua5.2 liblua5.2-dev
+        if: ${{ matrix.LIBLUA == '5.2' }}
+
+      - name: Setup packages (${{ matrix.LIBLUA }}
+        run: sudo apt install -y lua5.3 liblua5.3-dev
+        if: ${{ matrix.LIBLUA == '5.3' }}
+
+      - name: Setup packages (${{ matrix.LIBLUA }}
+        run: sudo apt install -y lua5.4 liblua5.4-dev
+        if: ${{ matrix.LIBLUA == '5.4' }}
+
+      - name: Running CMake
+        run: cmake -S . -B build
+
+      - name: Building
+        run: cmake --build build --parallel $(nproc)