aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/compile.yml
blob: 2ba771fceebefb2e1e12051cada726170c540ae3 (plain)
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
name: build all

on:
  # all branches:
  [ push, pull_request ]
  # trunk only:
  #push:
  #  branches: [ "trunk" ]
  #pull_request:
  #  branches: [ "trunk" ]

jobs:
  compile:
    runs-on: ubuntu-latest

    steps:

    - name: Checkout
      uses: actions/checkout@master
      # allow 'git describe' to work, by fetching tags and history
      with:
        fetch-depth: 0
        fetch-tags: true

    - name: Stop committing version.h
      # reject commit if version.h was changed
      run: grep 1969-07-20 ui/anduril/version.h

    - name: Requirements
      run: |
        sudo apt-get -qqy update
        sudo apt-get -qqy install avr-libc binutils-avr gcc-avr unzip wget

    - name: Cache Atmel DFPs
      id: cache-dfp
      uses: actions/cache@v3
      env:
        cache-name: cache-dfp-files
      with:
        path: arch/dfp
        # new cache whenever the dfp-install script changes
        key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('bin/dfp-install.sh') }}

    - name: Install Atmel DFPs
      if: steps.cache-dfp.outputs.cache-hit != 'true'
      run: |
        ./make dfp

    - name: Compile All
      run: |
        ./make
        echo "ARTIFACT_NAME=${GITHUB_WORKFLOW}-$(git rev-parse --short ${GITHUB_SHA})-${GITHUB_RUN_NUMBER}" >> "${GITHUB_ENV}"

    - name: Store Artifacts
      uses: actions/upload-artifact@v3
      with:
        name: ${{ env.ARTIFACT_NAME }}
        if-no-files-found: error
        path: |
          hex/*.hex