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

Upgrade all dependencies and fix tests #9

Merged
merged 4 commits into from Oct 2, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/push.yml
@@ -0,0 +1,30 @@
name: Push
on: push

env:
SLACKSYNC_CHANNEL: 'C7CPHQ337'
SLACKSYNC_TOKEN: '${{ secrets.SLACK_TOKEN }}'

jobs:
prepare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ./

tests:
runs-on: ubuntu-latest
needs: [prepare]
steps:
- uses: actions/checkout@v1
- run: npm install
- run: npm run build
- run: npm run pack
- run: export INPUT_GITHUB_TOKEN='${{ secrets.GITHUB_TOKEN }}' npm run test

conclusion:
runs-on: ubuntu-latest
needs: [tests]
steps:
- uses: actions/checkout@v1
- uses: ./
22 changes: 0 additions & 22 deletions .github/workflows/test.yml

This file was deleted.

12 changes: 6 additions & 6 deletions __tests__/main.test.ts
Expand Up @@ -2,14 +2,14 @@ import * as process from 'process'
import * as cp from 'child_process'
import * as path from 'path'

const REQUIRED_VARIABLES = ['INPUT_GITHUB_TOKEN', 'SLACKSYNC_CHANNEL', 'SLACKSYNC_TOKEN']

// shows how the runner will run a javascript action with env / stdout protocol
test('test runs', () => {
if (!process.env.SLACKSYNC_TOKEN) {
throw new Error('SLACKSYNC_TOKEN has to be set in order to run tests')
}

if (!process.env.SLACKSYNC_CHANNEL) {
throw new Error('SLACKSYNC_CHANNEL has to be set in order to run tests')
for (let env of REQUIRED_VARIABLES) {
if (!process.env[env]) {
throw new Error(`${env} has to be set in order to run tests`)
}
}

const ip = path.join(__dirname, '..', 'dist', 'main.js')
Expand Down