-
Notifications
You must be signed in to change notification settings - Fork 11
117 lines (105 loc) · 3.64 KB
/
ci.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: CI
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- '**'
permissions:
id-token: write
contents: read
env:
AWS_REGION: "eu-central-1"
AWS_DEFAULT_REGION: "eu-central-1"
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
jobs:
earthly-build-and-push:
uses: ./.github/workflows/earthly-build-and-push.yml
with:
repository: ${{ github.repository }}
branch: ${{ github.head_ref }}
upload: 'true'
secrets:
SUBSTRATE_REPO_SSH_KEY: ${{ secrets.SUBSTRATE_REPO_SSH_KEY }}
EARTHLY_TAR: ${{ secrets.EARTHLY_TAR }}
AWS_ROLE_ARN_SECRET: ${{ secrets.AWS_ROLE_ARN_SECRET }}
ECR_REGISTRY_SECRET: ${{ secrets.ECR_REGISTRY_SECRET }}
devshell-tests:
strategy:
matrix:
os: [nixos, macos]
runs-on: ${{ matrix.os }}
steps:
- name: Nix Devshells Tests
uses: ./.github/actions/tests/devshell-tests
env:
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }}
NIX_SIGNING_KEY: ${{ secrets.NIX_SIGNING_KEY }}
AWS_DEFAULT_REGION: "eu-central-1"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }}
deploy-argocd:
needs: earthly-build-and-push
if: ${{ github.event.pull_request.merged == true && !contains(github.event.pull_request.labels.*.name, 'ci-off') }}
runs-on: ubuntu-latest
steps:
- name: Deploy ArgoCD Node
uses: ./.github/actions/deploy/argocd/deploy-argocd
with:
sha: ${{ github.sha }}
env:
ACTIONS_PAT: ${{ secrets.ACTIONS_PAT }}
argocd-tests:
needs: deploy-argocd
runs-on: [self-hosted, eks]
steps:
- name: Run Tests
uses: ./.github/actions/tests/run-k8-tests
with:
node-host: sha-${{ github.sha }}-service.integration-testing.svc.cluster.local
node-port: 9933
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
AWS_ROLE_ARN_: ${{ secrets.AWS_ROLE_ARN_ }}
SSH_KEY_BINARY_HOST: ${{ secrets.SSH_KEY_BINARY_HOST }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
JIRA_URL: ${{ secrets.JIRA_URL }}
ACTIONS_PAT: ${{ secrets.ACTIONS_PAT }}
teardown-argocd:
needs: [earthly-build-and-push, deploy-argocd, argocd-tests]
if: ${{ always() && needs.generate-manifest.result == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Teardown ArgoCD Environment
uses: ./.github/actions/deploy/argocd/teardown-argocd
with:
sha: ${{ github.sha }}
env:
ACTIONS_PAT: ${{ secrets.ACTIONS_PAT }}
upload-chain-specs:
needs: [earthly-build-and-push]
if: ${{ github.ref_name == 'master' || inputs.upload == 'true' }}
runs-on: [self-hosted, eks]
steps:
- name: Upload chain spec artifacts to Kubernetes
uses: ./.github/actions/upload-chain-specs
with:
sha: ${{ github.sha }}
env:
kubeconfig_base64: ${{ secrets.kubeconfig_base64 }}
K8S_SERVER: ${{ secrets.K8S_SERVER }}
K8S_SA_TOKEN: ${{ secrets.K8S_SA_TOKEN }}
deploy-rustdoc:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'workflow_dispatch' || inputs.rustdoc == 'true' }}
steps:
- name: Deploy Rust Docs
uses: ./.github/actions/deploy/deploy-rustdoc
with:
ssh_key: ${{ inputs.ssh_key }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SSH_AUTH_SOCK: /tmp/ssh_agent.sock