-
-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (84 loc) · 2.9 KB
/
Copy pathdoccano_init.yml
File metadata and controls
95 lines (84 loc) · 2.9 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# This is a basic workflow to help you get started with Actions
name: DoccanoInit
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '15 * * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test-runner:
runs-on: [self-hosted, runner-grid]
steps:
- name: Show runner info
run: |
echo "Hello from self-hosted"
echo "Runner name: $RUNNER_NAME"
uname -a
# 1. New setup job to check runner availability
check_runner:
runs-on: ubuntu-latest
concurrency:
group: runner-determination
cancel-in-progress: false
outputs:
active_runner: ${{ steps.check.outputs.use-runner }}
steps:
- name: Wait for possible parallel workflow run job startup lag
run: sleep 6
- name: Check if runner-grid is online
id: check
# Using the actively maintained fork
uses: mikehardy/runner-fallback-action@v1
with:
primary-runner: "self-hosted,runner-grid"
fallback-runner: "ubuntu-latest"
primaries-required: 1
fallback-on-error: true
github-token: ${{ secrets.CUSTOM_PAT }}
- name: Log chosen runner
run: echo "!use-runner=${{ steps.check.outputs.use-runner }}"
# This workflow contains a single job called "build"
build:
needs: check_runner
runs-on: ${{ fromJSON(needs.check_runner.outputs.active_runner) }}
container:
image: ubuntu:22.04
options: --user root
services:
doccano:
image: doccano/doccano
env:
# Doccano Initialization Variables
ADMIN_USERNAME: admin
ADMIN_EMAIL: julia_jackson@gmail.com
ADMIN_PASSWORD: password
PORT: 6379
RABBITMQ_DEFAULT_USER: doccano
RABBITMQ_DEFAULT_PASS: doccano
POSTGRES_USER: doccano
POSTGRES_PASSWORD: doccano
POSTGRES_DB: doccano
ports:
- 6379:6379
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# Runs a single command using the runners shell
- name: Add in Docker Tools
run: sh ./scripts/docker_install.sh
- name: Run Doccano Ping Test
run: sh ./scripts/doccano_ping.sh
- name: Install julia
run: sh ./scripts/julia_install.sh
- name: Run Doccano Login Test
run: sh ./scripts/doccano_login.sh
- name: Run Full Doccano Endpoint Test
run: sh ./scripts/doccano_full_test.sh