-
Notifications
You must be signed in to change notification settings - Fork 30
82 lines (68 loc) · 2.57 KB
/
instruqt-dev-track-test.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
##############################################################################
# Instruqt Github Actions Workflow
#
# This workflow file and its actions will run a validate/push/test cycle on
# one or more Instruqt DEV tracks directories in your repo. Each job targets a
# separate directory of tracks. All the tracks in each directory must belong
# to the same organization.
#
##############################################################################
name: Test Development Track
env:
# Set these values to match your environment. Your token should be
# stored as a Github secret in your tracks repo. Also make sure you
# have a track-slugs.yml file in your tracks directory.
TRACK_DIR: instruqt
INSTRUQT_TOKEN: ${{ secrets.INSTRUQT_TOKEN }}
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
pull_request:
types: [opened, reopened, edited, synchronize]
workflow_dispatch:
jobs:
GetTrackSlugs:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install yq Package
uses: ./.github/actions/install-yq
- name: Create Matrix Data
run: echo "TRACKS=$(yq -o j $TRACK_DIR/track-slugs.yml | jq tostring | sed -e 's/^"//' -e 's/"$//')" >> $GITHUB_ENV
- id: set-matrix
run: echo "::set-output name=matrix::${{ env.TRACKS }}"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
TestDevTracks:
runs-on: ubuntu-latest
needs: GetTrackSlugs
strategy:
matrix: ${{ fromJson(needs.GetTrackSlugs.outputs.matrix) }}
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install yq Package
uses: ./.github/actions/install-yq
- name: Convert to DEV version
uses: ./.github/actions/track-dev
with:
path: ${{ env.TRACK_DIR }}/${{ matrix.tracks.slug }}
# Remaining steps will skip any tracks that do not have existing DEV variants on Instruqt
- name: Pull track from instruqt
id: track-pull
uses: ./.github/actions/track-pull
with:
path: ${{ env.TRACK_DIR }}/${{ matrix.tracks.slug }}
continue-on-error: true
- name: Track Validate
uses: ./.github/actions/track-validate
with:
path: ${{ env.TRACK_DIR }}/${{ matrix.tracks.slug }}
if: steps.track-pull.outcome == 'success'
- name: Track Test
uses: ./.github/actions/track-test
with:
path: ${{ env.TRACK_DIR }}/${{ matrix.tracks.slug }}
if: steps.track-pull.outcome == 'success'