diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..6af46c5 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,19 @@ +name: Docker Image CI + +on: + push: + branches: [ "jr0013909-patch-4" ] + pull_request: + branches: [ "jr0013909-patch-4" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) + docker run --rm my-image my-image-test-command diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml new file mode 100644 index 0000000..383e65c --- /dev/null +++ b/.github/workflows/pylint.yml @@ -0,0 +1,23 @@ +name: Pylint + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pylint + - name: Analysing the code with pylint + run: | + pylint $(git ls-files '*.py') diff --git a/dbot.py b/dbot.py index ccc99db..3270bd1 100644 --- a/dbot.py +++ b/dbot.py @@ -26,7 +26,7 @@ async def on_ready(self): print('Logged on as {0}!'.format(self.user)) async def on_message(self, message): - print('Message from {0.author}: {0.content}'.format(message)) + print('Message*** from {0.author}: {0.content}'.format(message)) if message.author == client.user: return if message.content == '!stop': await client.logout() #if message.content.startswith('!ping'): await message.channel.send('Pong!') @@ -35,4 +35,4 @@ async def on_member_join(self, member): await member.send(join_greeting) client = MyClient() -client.run(token) \ No newline at end of file +client.run(token)