From ebfa563d314599afbb488b8d779c597279fe3621 Mon Sep 17 00:00:00 2001 From: Tom Hensel Date: Sun, 5 Nov 2023 03:47:30 +0100 Subject: basic compile workflow publishing artifacts to test --- .github/workflows/compile.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/compile.yml diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml new file mode 100644 index 0000000..9b06253 --- /dev/null +++ b/.github/workflows/compile.yml @@ -0,0 +1,33 @@ +name: anduril + +on: + push: + branches: [ "main", "actions" ] + pull_request: + branches: [ "main" ] + +jobs: + compile: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@master + - name: Requirements + run: | + sudo apt-get -qqy update + sudo apt-get -qqy install avr-libc binutils-avr wget gcc-avr unzip + - name: Install Device Family Pack + run: | + ./make dfp + - name: Compile All + run: | + ./bin/build-all.sh + echo "ARTIFACT_NAME=${GITHUB_WORKFLOW}-${GITHUB_REF_NAME}-$(git rev-parse --short ${GITHUB_SHA})-${GITHUB_RUN_NUMBER}" >> "${GITHUB_ENV}" + - name: Store Artifacts + uses: actions/upload-artifact@master + with: + name: ${{ env.ARTIFACT_NAME }} + if-no-files-found: error + path: | + hex/*.hex -- cgit v1.2.3 From 0aeb1b226c10586c8923b818a9dda7d51cab798a Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 5 Nov 2023 13:00:01 -0700 Subject: initial test to fix branch names and see if actions work --- .github/workflows/compile.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 9b06253..78ca9cc 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -1,29 +1,34 @@ -name: anduril +name: build all on: push: - branches: [ "main", "actions" ] + branches: [ "trunk", "gretel-actions" ] pull_request: - branches: [ "main" ] + branches: [ "trunk" ] jobs: compile: runs-on: ubuntu-latest steps: + - name: Checkout uses: actions/checkout@master + - name: Requirements run: | - sudo apt-get -qqy update - sudo apt-get -qqy install avr-libc binutils-avr wget gcc-avr unzip + sudo apt -qqy update + sudo apt -qqy install avr-libc binutils-avr gcc-avr wget unzip + - name: Install Device Family Pack run: | ./make dfp + - name: Compile All run: | - ./bin/build-all.sh + ./make echo "ARTIFACT_NAME=${GITHUB_WORKFLOW}-${GITHUB_REF_NAME}-$(git rev-parse --short ${GITHUB_SHA})-${GITHUB_RUN_NUMBER}" >> "${GITHUB_ENV}" + - name: Store Artifacts uses: actions/upload-artifact@master with: -- cgit v1.2.3 From 7bf25607f1f7519b02521b941bfa4690eece44df Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 5 Nov 2023 13:08:15 -0700 Subject: help CI detect build failures made 'make' and 'build-all.sh' exit with an error on fail, so CI can hopefully detect it... and added an intentional source bug to make it fail for testing purposes --- bin/build-all.sh | 1 + hw/fireflies/arch | 2 +- make | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/build-all.sh b/bin/build-all.sh index 2d443a5..ac8ea98 100755 --- a/bin/build-all.sh +++ b/bin/build-all.sh @@ -66,4 +66,5 @@ echo "===== $PASS builds succeeded, $FAIL failed =====" #echo "PASS: $PASSED" if [ 0 != $FAIL ]; then echo "FAIL:$FAILED" + exit 1 fi diff --git a/hw/fireflies/arch b/hw/fireflies/arch index d16b0f8..dcd026a 100644 --- a/hw/fireflies/arch +++ b/hw/fireflies/arch @@ -1 +1 @@ -attiny85 +attiny69 diff --git a/make b/make index 8d3d801..89e196d 100755 --- a/make +++ b/make @@ -59,7 +59,7 @@ function main() { ;; dfp) shift - ./bin/dfp-install.sh "$@" + exec ./bin/dfp-install.sh "$@" ;; docs) make-docs @@ -79,7 +79,7 @@ function main() { grep -E 'TODO:|FIXME:' **/*.[ch] ;; *) - ./bin/build-all.sh "$@" + exec ./bin/build-all.sh "$@" ;; esac } -- cgit v1.2.3 From 41e479bee5ef2ce73d5c5cde405c6096b1177394 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 5 Nov 2023 13:11:14 -0700 Subject: fixed intentional error, because CI build-fail test worked correctly --- hw/fireflies/arch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/fireflies/arch b/hw/fireflies/arch index dcd026a..d16b0f8 100644 --- a/hw/fireflies/arch +++ b/hw/fireflies/arch @@ -1 +1 @@ -attiny69 +attiny85 -- cgit v1.2.3 From 6fe353f80cd0d308ec2d05e090082d4e35864d6d Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 5 Nov 2023 13:50:27 -0700 Subject: github actions: cache the Atmel DFP files between runs --- .github/workflows/compile.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 78ca9cc..c6278d3 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -18,9 +18,20 @@ jobs: - name: Requirements run: | sudo apt -qqy update - sudo apt -qqy install avr-libc binutils-avr gcc-avr wget unzip + sudo apt -qqy install avr-libc binutils-avr gcc-avr unzip wget - - name: Install Device Family Pack + - 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 -- cgit v1.2.3 From 6e78c50d7c5b5a8a874f962f4cc8229b23f2cc06 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 5 Nov 2023 14:10:22 -0700 Subject: test: is apt-get any faster than apt? --- .github/workflows/compile.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index c6278d3..e3371ec 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -17,8 +17,8 @@ jobs: - name: Requirements run: | - sudo apt -qqy update - sudo apt -qqy install avr-libc binutils-avr gcc-avr unzip wget + 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 @@ -41,7 +41,7 @@ jobs: echo "ARTIFACT_NAME=${GITHUB_WORKFLOW}-${GITHUB_REF_NAME}-$(git rev-parse --short ${GITHUB_SHA})-${GITHUB_RUN_NUMBER}" >> "${GITHUB_ENV}" - name: Store Artifacts - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v3 with: name: ${{ env.ARTIFACT_NAME }} if-no-files-found: error -- cgit v1.2.3 From 962b571eac828f1ad334fb043b6265fbf16e6b61 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 5 Nov 2023 14:17:27 -0700 Subject: removed test branch from action triggers (the action works and seems ready to merge) --- .github/workflows/compile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index e3371ec..fabcf31 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -2,7 +2,7 @@ name: build all on: push: - branches: [ "trunk", "gretel-actions" ] + branches: [ "trunk" ] pull_request: branches: [ "trunk" ] -- cgit v1.2.3