-
Notifications
You must be signed in to change notification settings - Fork 9
77 lines (66 loc) · 2.51 KB
/
test-and-build.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
name: "Test and (if tag) build"
on:
# TODO: We currently get double workflows when pushing to pull request
# branches. Set this to only run on pushes to `main` and pull requests
# instead?
push:
branches:
- "*"
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
pull_request:
# Default to bash in login mode; key to activating conda environment
# https://github.com/mamba-org/provision-with-micromamba#IMPORTANT
defaults:
run:
shell: "bash -l {0}"
jobs:
test:
runs-on: "ubuntu-latest"
steps:
- name: "Check out repository"
uses: "actions/checkout@v3"
- name: "Apt install libgl1-mesa-glx"
run: |
# Install libgl1-mesa-glx. Import errors occur otherwise.
# See: https://app.circleci.com/jobs/github/nsidc/qgreenland/72/parallel-runs/0/steps/0-102
sudo apt-get update
sudo apt-get install -y libgl1-mesa-glx
- name: "Install Conda environment"
uses: "mamba-org/setup-micromamba@v1"
with:
micromamba-version: "1.4.2-2"
environment-file: "conda-lock.yml"
# When using a lock-file, we have to set an environment name.
environment-name: "qgreenland-ci"
cache-environment: true
# Increase this key to trigger cache invalidation
cache-environment-key: 1
- name: "Run tests"
run: "inv test.ci"
env:
# QGIS complains when setting up an QgsApplicatoin if `QT_QPA_PLATFORM` is not
# set to `offscreen`:
# qt.qpa.xcb: could not connect to display
# qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even
# though it was found.
# This application failed to start because no Qt
# platform plugin could be initialized. Reinstalling the application
# may fix this problem.
#
# Available platform plugins are: eglfs, minimal, minimalegl,
# offscreen, vnc, webgl, xcb.
#
# Fatal Python error: Aborted
QT_QPA_PLATFORM: offscreen
build:
runs-on: "ubuntu-latest"
needs: ["test"]
if: "github.ref_type == 'tag'"
steps:
- name: "Trigger Jenkins to build QGreenland Core"
run: |
JOB_NAME="qgreenland_C3_Production_Build_QGreenland_Package"
JOB_URL="${{ secrets.JENKINS_URL }}/job/${JOB_NAME}"
JOB_BUILD_URL="${JOB_URL}/buildWithParameters?ref=${{ github.ref_name }}&delay=5sec"
wget "$JOB_BUILD_URL"