Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrated from Travis CI to Github Actions. #11

Merged
merged 1 commit into from
Sep 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion .travis/Makefile → .github/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ build:
# Setup a build environment
@$(DOCKER) build -t $(MODULE):build .
@$(DOCKER) run --rm -v $(shell pwd)/..:/build $(MODULE):build bash -c \
'make -C /build/.travis build-module'
'make -C /build/.github build-module'

build-module: clean install .find-deps
# Build $(MODULE) module from source
Expand Down
2 changes: 2 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tag-template: v$NEXT_MINOR_VERSION
template: $CHANGES
File renamed without changes.
41 changes: 41 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Package
on:
release:
types: [published]

concurrency:
group: '${{ github.event_name }}'
cancel-in-progress: false

jobs:
package:
name: Build the module package
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- name: Prepare the virtual environment
uses: hausgold/actions/ci@master
with:
clone_token: '${{ secrets.CLONE_TOKEN }}'
settings: '${{ github.repository }}'
target: ci/docker
- uses: actions/checkout@v2

- name: Configure the module version
run: var MOD_VERSION ${APP_REF}

# TODO: Remove after testing.
- name: debug1
run: echo ${MOD_VERSION}

- name: Build the module
run: make -C .github build package

# TODO: Remove after testing.
- name: debug2
run: ls -lisa

- name: Upload built module package
run: >
release-asset '${{ github.event.release.id }}'
"ejabberd-mam2sidekiq-${MOD_VERSION}.tar.gz"
17 changes: 17 additions & 0 deletions .github/workflows/process.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Process

on:
push:
branches:
- main
- master

jobs:
release_drafter:
name: Update release draft
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50 changes: 50 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Test
on:
push:
branches:
- '**'
schedule:
- cron: '0 0 * * MON'

concurrency:
group: '${{ github.ref }}'
cancel-in-progress: true

jobs:
test:
name: Test the module
runs-on: ubuntu-20.04
timeout-minutes: 5
steps:
- name: Prepare the virtual environment
uses: hausgold/actions/ci@master
with:
clone_token: '${{ secrets.CLONE_TOKEN }}'
settings: '${{ github.repository }}'
target: ci/docker
- uses: actions/checkout@v2

- name: Install the module dependencies
run: make install

- name: Start the module dependencies
run: START=background make start reload

- name: Run the module tests
run: make test

build:
name: Build the module
runs-on: ubuntu-20.04
timeout-minutes: 5
steps:
- name: Prepare the virtual environment
uses: hausgold/actions/ci@master
with:
clone_token: '${{ secrets.CLONE_TOKEN }}'
settings: '${{ github.repository }}'
target: ci/docker
- uses: actions/checkout@v2

- name: Build the module
run: make -C .github build
61 changes: 0 additions & 61 deletions .travis.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .travis/exe/docker-glue

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## next

* Migrated from Travis CI to Github Actions (#11)

## 1.0.1

* Do not remove the meta.user data from a MUC packet in order to not interfere
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 HAUSGOLD
Copyright (c) 2021 HAUSGOLD | talocasa GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SHELL := bash
# Environment switches
MAKE_ENV ?= docker
IMAGE_VENDOR ?= hausgold
PROJECT_NAME ?= jabberreadmarkers
PROJECT_NAME ?= jabbermam2sidekiq
START ?= foreground
START_CONTAINERS ?= jabber
BUNDLE_FLAGS ?=
Expand Down Expand Up @@ -134,25 +134,25 @@ COMPOSE := $(COMPOSE) -p $(PROJECT_NAME)
@$(eval BASH_RUN_SHELL_CONTAINER = jabber)
@$(eval COMPOSE_RUN_COMMAND = exec)
@$(eval BASH_RUN_SHELL_USER = root)
@$(eval COMPOSE_RUN_SHELL_FLAGS = )
@$(eval COMPOSE_RUN_SHELL_FLAGS = -T)

.redis:
@$(eval BASH_RUN_SHELL_CONTAINER = redis)
@$(eval COMPOSE_RUN_COMMAND = exec)
@$(eval BASH_RUN_SHELL_USER = root)
@$(eval COMPOSE_RUN_SHELL_FLAGS = )
@$(eval COMPOSE_RUN_SHELL_FLAGS = -T)

.database:
@$(eval BASH_RUN_SHELL_CONTAINER = db)
@$(eval COMPOSE_RUN_COMMAND = exec)
@$(eval BASH_RUN_SHELL_USER = root)
@$(eval COMPOSE_RUN_SHELL_FLAGS = )
@$(eval COMPOSE_RUN_SHELL_FLAGS = -T)

.test:
@$(eval BASH_RUN_SHELL_CONTAINER = jabber)
@$(eval COMPOSE_RUN_COMMAND = exec)
@$(eval BASH_RUN_SHELL_USER = app)
@$(eval COMPOSE_RUN_SHELL_FLAGS = )
@$(eval COMPOSE_RUN_SHELL_FLAGS = -T)

.e2e:
@$(eval BASH_RUN_SHELL_CONTAINER = e2e)
Expand Down
2 changes: 1 addition & 1 deletion include/mod_mam2sidekiq.hrl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-define(MODULE_VERSION, <<"1.0.1-477">>).
-define(MODULE_VERSION, <<"1.0.1-478">>).
-define(NS_MAM_SIDEKIQ, <<"xmpp:mam:hausgold:sidekiq">>).

%% A macro to convert a record to tuple{[tuples]} for jiffy (JSON) encoding
Expand Down
2 changes: 0 additions & 2 deletions src/mod_mam2sidekiq.erl
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ start(Host, _Opts) ->
%% Stop the module, and deregister all hooks.
-spec stop(binary()) -> any().
stop(Host) ->
%% Deregister the custom XMPP codec
xmpp:unregister_codec(hg_read_markers),
%% Deregister all the hooks
ejabberd_hooks:delete(store_mam_message,
Host, ?MODULE, on_store_mam_message, 101),
Expand Down
8 changes: 2 additions & 6 deletions tests/e2e/app/some_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,8 @@ def perform(message, source)
sleep 2
puts "> end-to-end test finished.\n\n".bold.green

# We need kill our parent process here, because Sidekiq is not designed
# to be closed from within a job
pid = `ps -a`.lines.grep(/bundle/).first.strip.split(' ').first
system("kill -9 #{pid}")
sleep 1
system("kill -9 #{pid}")
# Signal Sidekiq to shutdown in order to finish the test
Sidekiq::ProcessSet.new.each(&:stop!)
end
end
end
1 change: 1 addition & 0 deletions tests/e2e/config/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

require 'bundler/setup' # Set up gems listed in the Gemfile.
Bundler.require(:default)
require 'sidekiq/api'
require_relative '../app/some_worker'

url = 'redis://redis/5'
Expand Down
55 changes: 32 additions & 23 deletions tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading