-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into isolate-requires
- Loading branch information
Showing
32 changed files
with
933 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,63 @@ | ||
# ATTENTION | ||
# | ||
# This is *not* a typical busted workflow! Do not copy this to other projects! | ||
# Instead of installing busted from somewhere and using it on a code base, | ||
# we're actually building and running the current HEAD version on ourselves: | ||
# basically this is a combination bootstrap test and dogfooding. The upshot is | ||
# that we check both that everything works (and end-to-end test) and that the | ||
# current codebase checks against itself. This ensures we can fix a bug or make | ||
# a breaking change in busted without being blocked by our own CI using a | ||
# different busted version. | ||
# | ||
# See the README.md file for examples suitable for use in other projects. | ||
|
||
name: Busted | ||
|
||
on: [push, pull_request] | ||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
|
||
busted: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
luaVersion: ["5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty"] | ||
penlightVersion: ["1.9.2", "1.8.0", "1.6.0", "1.3.2"] | ||
runs-on: ubuntu-20.04 | ||
luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit" ] #, "luajit-openresty" ] | ||
penlightVersion: [ "1.13.1", "1.9.2", "1.8.0", "1.6.0", "1.3.2" ] | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup ‘lua’ | ||
uses: leafo/gh-actions-lua@v8 | ||
with: | ||
luaVersion: ${{ matrix.luaVersion }} | ||
- name: Setup ‘luarocks’ | ||
uses: leafo/gh-actions-luarocks@v4 | ||
- name: Setup dependencies | ||
run: | | ||
sudo apt-get install libev-dev | ||
luarocks install penlight ${{ matrix.penlightVersion }} | ||
luarocks install --only-deps busted-scm-2.rockspec | ||
luarocks install luasec | ||
luarocks install moonscript | ||
luarocks install copas | ||
luarocks install lua-ev | ||
- name: Cache Lua machinery | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
.install | ||
.lua | ||
.luarocks | ||
key: lua-${{ matrix.luaVersion }}-${{ matrix.penlightVersion }}-${{ hashFiles('busted-scm-2.rockspec', '.github/workflows/busted.yml') }} | ||
- name: Build | ||
run: | | ||
luarocks remove busted --force ||: | ||
luarocks make | ||
- name: Run tests | ||
run: busted -v | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup ‘lua’ | ||
uses: leafo/gh-actions-lua@v9 | ||
with: | ||
luaVersion: ${{ matrix.luaVersion }} | ||
|
||
- name: Setup ‘luarocks’ | ||
uses: leafo/gh-actions-luarocks@v4 | ||
|
||
- name: Setup dependencies | ||
run: | | ||
sudo apt-get install libev-dev | ||
luarocks install penlight ${{ matrix.penlightVersion }} | ||
luarocks install luasec | ||
luarocks install moonscript | ||
luarocks install copas | ||
luarocks install lua-ev | ||
luarocks install luacov | ||
luarocks install --deps-only busted-scm-1.rockspec | ||
- name: Build ‘busted’ (bootstrap) | ||
run: | | ||
luarocks make | ||
- name: Run ‘busted’ (dogfood) | ||
# disable project-local path prefixes to force use of system installation | ||
run: busted --coverage --lpath="" --cpath="" -Xoutput --color | ||
|
||
- name: Report test coverage | ||
if: ${{ success() && github.repository == 'lunarmodules/busted' }} | ||
continue-on-error: true | ||
run: luacov-coveralls -i src -e .luarocks | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ github.token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Deploy | ||
|
||
on: [ push, workflow_dispatch ] | ||
|
||
jobs: | ||
|
||
affected: | ||
uses: lunarmodules/.github/.github/workflows/list_affected_rockspecs.yml@main | ||
|
||
build: | ||
needs: affected | ||
if: ${{ needs.affected.outputs.rockspecs }} | ||
uses: lunarmodules/.github/.github/workflows/test_build_rock.yml@main | ||
with: | ||
rockspecs: ${{ needs.affected.outputs.rockspecs }} | ||
|
||
upload: | ||
needs: [ affected, build ] | ||
# Only run upload if: | ||
# 1. We are on the canonical repository (no uploads from forks) | ||
# 2. The current commit is either tagged or on the default branch (the workflow will upload dev/scm rockspecs any | ||
# time they are touched, tagged ones whenever the edited rockspec and tag match) | ||
# 3. Some rockspecs were changed — this implies the commit changing the rockspec is the same one that gets tagged | ||
if: >- | ||
${{ | ||
github.repository == 'lunarmodules/busted' && | ||
( github.ref_name == 'master' || startsWith(github.ref, 'refs/tags/') ) && | ||
needs.affected.outputs.rockspecs | ||
}} | ||
uses: lunarmodules/.github/.github/workflows/upload_to_luarocks.yml@main | ||
with: | ||
rockspecs: ${{ needs.affected.outputs.rockspecs }} | ||
secrets: | ||
apikey: ${{ secrets.LUAROCKS_APIKEY }} | ||
|
||
docker: | ||
if: >- | ||
${{ | ||
github.repository == 'lunarmodules/busted' && | ||
( github.ref_name == 'master' || startsWith(github.ref, 'refs/tags/') ) | ||
}} | ||
uses: lunarmodules/.github/.github/workflows/docker_ghcr_deploy.yml@main | ||
with: | ||
username: ${{ github.actor }} | ||
tag: ${{ github.ref_name }} | ||
secrets: | ||
token: ${{ secrets.GHCR_PAT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Versioning | ||
|
||
on: | ||
release: | ||
types: [ created, published, edited ] | ||
|
||
jobs: | ||
actions-tagger: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Update release tags | ||
uses: Actions-R-Us/actions-tagger@v2 | ||
with: | ||
publish_latest_tag: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
*.swp | ||
/luacov.report.out | ||
/.ignore* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#syntax=docker/dockerfile:1.2 | ||
|
||
FROM akorn/luarocks:lua5.4-alpine AS builder | ||
|
||
RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing \ | ||
dumb-init gcc libc-dev | ||
|
||
COPY ./ /src | ||
WORKDIR /src | ||
|
||
RUN luarocks --tree /pkgdir/usr/local make | ||
RUN find /pkgdir -type f -exec sed -i -e 's!/pkgdir!!g' {} \; | ||
|
||
FROM akorn/luarocks:lua5.4-alpine AS final | ||
|
||
RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing \ | ||
dumb-init | ||
|
||
LABEL org.opencontainers.image.title="Busted" | ||
LABEL org.opencontainers.image.description="A containerized version of Busted, a unit testing framework for Lua." | ||
LABEL org.opencontainers.image.authors="Caleb Maclennan <[email protected]>" | ||
LABEL org.opencontainers.image.licenses="MIT" | ||
LABEL org.opencontainers.image.url="https://github.com/lunarmodules/busted/pkgs/container/busted" | ||
LABEL org.opencontainers.image.source="https://github.com/lunarmodules/busted" | ||
|
||
COPY --from=builder /pkgdir / | ||
RUN busted --version | ||
|
||
WORKDIR /data | ||
|
||
ENTRYPOINT ["busted", "--verbose", "--output=gtest"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Lua Busted | ||
description: Busted | ||
inputs: | ||
args: | ||
description: Arguments passed to busted | ||
required: false | ||
default: "." | ||
runs: | ||
using: docker | ||
image: docker://ghcr.io/lunarmodules/busted:v2.1.1 | ||
entrypoint: sh | ||
args: | ||
- -c | ||
- busted ${{ inputs.args }} | ||
branding: | ||
icon: check | ||
color: yellow |
Oops, something went wrong.