-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (64 loc) · 2.04 KB
/
test.workflow.push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: "Test 'Push' Workflow"
on:
push:
branches:
- main
jobs:
# same job as build.yml copied here to keep build & E2E workflows separate
# Can be optimized once Github supports Actions partials
build:
name: Test build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build
run: yarn build
- name: Ensure build was committed (necessary for Github Actions)
run: "[[ -z $(git status -s dist) ]]"
- name: "[Test] Unit tests"
run: yarn test
e2e-test:
name: "'Push' E2E tests"
if: github.repository == 'Olivr/copybara-action'
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: "[Test] Basic usage"
uses: ./
with:
sot_repo: Olivr/copybara-action
destination_repo: olivr-test/copybara-action-test
access_token: ${{ secrets.GH_TOKEN_BOT }}
ssh_key: ${{ secrets.GH_SSH_BOT }}
- name: "[Test] Missing repos"
id: missing-repos
continue-on-error: true
uses: ./
with:
destination_repo: olivr-test/copybara-action-test
ssh_key: ${{ secrets.GH_SSH_BOT }}
workflow: push
- name: ".........⏳"
if: steps.missing-repos.outcome != 'failure' || !startsWith(steps.missing-repos.outputs.msg, '[action]')
run: exit 1
- name: "[Test] Missing token"
id: missing-token
continue-on-error: true
uses: ./
with:
sot_repo: Olivr/copybara-action
destination_repo: olivr-test/copybara-action-test
ssh_key: ${{ secrets.GH_SSH_BOT }}
- name: "..........⏳"
if: steps.missing-token.outcome != 'failure' || !startsWith(steps.missing-token.outputs.msg, '[action]')
run: exit 1