-
Notifications
You must be signed in to change notification settings - Fork 9
102 lines (85 loc) · 3.04 KB
/
upload.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
# Copyright 2018-2022 F4PGA Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
name: Upload data to GCP
on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
jobs:
Upload-Interchange-Data:
runs-on: [self-hosted, Linux, X64, gcp-custom-runners]
container: ubuntu:focal
env:
GHA_SA: "gh-sa-interchange-tests-ci"
GCP_BUCKET: fpga-interchange-tests/artifacts/prod/foss-fpga-tools/fpga-interchange-tests/continuous
DEBIAN_FRONTEND: noninteractive
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install prerequisites
run: |
.github/scripts/ubuntu-setup.sh
apt install -qqy pixz
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
apt update -qqy
apt install -qqy gnupg2 google-cloud-cli
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- name: Save timestamp
id: timestamp
run: |
echo TIMESTAMP="$(date +'%Y%m%d-%H%M%S')" >> $GITHUB_ENV
- name: Generate interchange data
run: |
.github/scripts/pack-interchange-data.sh \
interchange_tarballs \
links \
https://storage.googleapis.com/${GCP_BUCKET}/${TIMESTAMP}
- name: Upload data to GCP
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: |
gsutil -m cp interchange_tarballs/* gs://${GCP_BUCKET}/${TIMESTAMP}
- name: 'Upload artifact: latest'
uses: actions/upload-artifact@v3
with:
name: latest
path: links/*
- name: 'Upload artifact: resource-utilization'
uses: actions/upload-artifact@v3
with:
name: resource-utilization
path: |
**/plot_*.svg
Update-Latest-Links:
runs-on: ubuntu-latest
needs: Upload-Interchange-Data
steps:
- name: 'Download artifact: latest'
uses: actions/download-artifact@v3
with:
name: latest
path: links
- name: Store link to GCP in latest release
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: pyTooling/Actions/releaser@r0
with:
token: ${{ github.token }}
tag: latest
files: links/*