mirror of
https://github.com/lowobservable/coax.git
synced 2026-01-12 00:43:00 +00:00
GitHub Actions maintenance
This commit is contained in:
parent
2ce8075dae
commit
898edaf332
65
.ci/infrastructure/.terraform.lock.hcl
generated
65
.ci/infrastructure/.terraform.lock.hcl
generated
@ -2,41 +2,46 @@
|
||||
# Manual edits may be lost in future updates.
|
||||
|
||||
provider "registry.terraform.io/hashicorp/aws" {
|
||||
version = "3.62.0"
|
||||
constraints = "~> 3.0"
|
||||
version = "5.14.0"
|
||||
constraints = "5.14.0"
|
||||
hashes = [
|
||||
"h1:OxJqmYKlCkE5iJK3/NoCP+9EQXQQD2ORdwnRIHaTlgs=",
|
||||
"zh:08a94019e17304f5927d7c85b8f5dade6b9ffebeb7b06ec0643aaa1130c4c85d",
|
||||
"zh:0e3709f6c1fed8c5119a5653bec7e3069258ddf91f62d851f8deeede10487fb8",
|
||||
"zh:0ed32886abce5fee49f1ae49b84472558224366c31a638e51c63061c3126e7c2",
|
||||
"zh:0f1ecbeddfa61d87701a3f3b463e508773171981bf6dad8b1313a9eafaffd5e1",
|
||||
"zh:724cde4f27253b547714a606288ede17f5df67f430438478feed113d7acb5ac7",
|
||||
"zh:81e6e751a168eab1a054230d4441b43c68693bfb6e0545536f2ea6dbb39fe9af",
|
||||
"zh:84deaf1c6661ba0dbc07ac159109fb6746772476646d39854c755c8dfb7a8ac4",
|
||||
"zh:909dcefc6c986c926ad856662ab5d38a3988b1906569387b5b58e7ddd89a155c",
|
||||
"zh:d03886705e9f25d4bebeae115bb07e36adb14e778859cedb2bf3c3bed39f4d2b",
|
||||
"zh:de9fc80c5a5d3be7535856242c823a92516eb7d5c16ae509fa10b92cd6b3fa9b",
|
||||
"zh:e91dcd9eec8b779a9b089f2f8d45f1047f890cb7b9241490451da52c04cef63d",
|
||||
"h1:KjsjWBIOb+WQRSEaQex2KGwlmCG+SrAUcLKXoH0actE=",
|
||||
"zh:03b80869b97dfca4ce6ee94a005e15ccec4d98af0876084a963963b05c9ab743",
|
||||
"zh:11d148800fe028fcd10590f0473c5df306e220776e359aa838c2f07e5a89187e",
|
||||
"zh:15d696cf583dc2917b257891e4a33afe7c3e8f20b63183f510267d709baaaf3d",
|
||||
"zh:34c41e44534fbbf95a5f89b38404ee52b41c6c70af68f7e63a423b276fbcf797",
|
||||
"zh:4211d0fd4753f7ba202f3e4a8afb2e03d12112dd4db4f9267c472bd597dc71ca",
|
||||
"zh:47b6017d0cdd2f62b9e46137de38cd618441f658f8570a8e2687cce7643bf953",
|
||||
"zh:51785b942d6f588825f4bfa86e05502be8721194b289c474121072e49acff6c3",
|
||||
"zh:565f76885d41ecfea192b8a2e2f3d4b3dd278790d1d82b204706ae3582d51cf6",
|
||||
"zh:703d670e1d73360d2533b02dbe9e2e055bf6f36a478cd4d66f2349861575c2ed",
|
||||
"zh:7e4701f38590c22066da90b75dd92d81a685225d2d222d22425b7ccb26e92b4a",
|
||||
"zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425",
|
||||
"zh:ca3449252d70df14ad713d5b95fa0610da8087f12c9deb87beffe788f518d06d",
|
||||
"zh:e2ed3d6d8c12d3fe56fb03fe272779270a92f6157ade8c3db1c987b83b62e68c",
|
||||
"zh:f0b07b84a43d1afc3a9790ca699771970525c132fa8551e7b326d1f263414dd1",
|
||||
"zh:f1d83b3e5a29bae471f9841a4e0153eac5bccedbdece369e2f6186e9044db64e",
|
||||
]
|
||||
}
|
||||
|
||||
provider "registry.terraform.io/integrations/github" {
|
||||
version = "4.16.0"
|
||||
constraints = "~> 4.0"
|
||||
version = "5.34.0"
|
||||
constraints = "5.34.0"
|
||||
hashes = [
|
||||
"h1:IrC2CowOQFtQCwDsysvS1fb46197Z5i0wIKslB1GnF8=",
|
||||
"zh:24454b9082c5793d288e560d631c49ca4a803c26f151cb2853adb8966403f672",
|
||||
"zh:2fbac366eaa67ef6ba0ad3714cbf0a795303bc8f1131bafec3bfa02fc87c90fb",
|
||||
"zh:2fdf6daa059d4e996ed908d4a35dd65f681914f521ba7e47e57f292e4de525d2",
|
||||
"zh:31704c3b3963a6ef18e38812cec6993e3f81c31e8a76ee047b2fc0e5cbb176d3",
|
||||
"zh:84ef0f7002717d63b10457b83df7c649a4e347f2ebcd69c1912190938a1fb6c5",
|
||||
"zh:8ed0af87ce15eece9414870134a8b68dfef064da8d584167366bdda824159f45",
|
||||
"zh:995c61d6d6e3b1d2c020a6666fe9ab73b6eebddfb1c6209c9711bf26d62781fd",
|
||||
"zh:9c2bed37302f4414eefc6751c0e2cba702d76286caaa4ea931d218c544e52e63",
|
||||
"zh:b2b28adbff9cc2fcfa221de4cdf8b2b17bd4fdd7c6ba5aa73153387e02d4e7f5",
|
||||
"zh:b7143da120c9799233f667e738dc94e49e9a325689aa4ca629766ec6577300a6",
|
||||
"zh:f671bb37978affb5ff876c9fb1815fdcad52549f607276db7c0c70ed345efddd",
|
||||
"zh:f6bbd2b6ee07a47959804e2eeec94cd8b2ac0a90febc322ed87f84efd0e9df4e",
|
||||
"zh:ff21d2a68c7b63dda5bfacee500943fc6931bdac536b50396fa36d2f07b0177c",
|
||||
"h1:cqONWwrmsDhf8bqHcSXeN08DOrSxU6yoGYiKTVXh9SA=",
|
||||
"zh:1f7405d5b29f6c2c76742abf254a13ce553f72c5abd2c5533d0581b4ad4ab794",
|
||||
"zh:340e9ae09768075c8057c24f4ecf67b429317b59a4c78f99f30a67c8ced255ed",
|
||||
"zh:369e7933336216bb32a4220698816c9eb5b1a0a20950f0649368bbd791ab457e",
|
||||
"zh:59917a578a4a9b50657e955382c05222d5bda37f6005b7e78c20a2f91fe17f31",
|
||||
"zh:59c4d187bfd110ccfdd42a5ce82231d53e24631b1e5602a61010bde7a0b696b1",
|
||||
"zh:736a4a17b30598642d1ff556fe5c27ac61bf48bf887db2a2e5d846430f37b3f6",
|
||||
"zh:98fdd5ff17c6262da479c0f5d731f08e5fd9d77188bf5615d07e4e5c76c02bfc",
|
||||
"zh:9fb457920e67984cb00dc505d1eb9d4eb37ca064ce9efb2e36b67e130465a8f6",
|
||||
"zh:c81500212f716b3c2e5c6cbe9438ce8edeb2051b67a0ffed69b5a29206262187",
|
||||
"zh:dd054762bb339b20addde1d2a1326b0efaf0c15ae80fa84c670934c46bd0dca8",
|
||||
"zh:e0989f0c22f316156bc63aef19ad97969633407b743246d9804afba261fbff34",
|
||||
"zh:e7e53b541e551723274cdf8068b89c237ea0f73a6d717aaa67656813df2d7ccf",
|
||||
"zh:f5acfddba8a8a67fae8522c944e90df61e27249853a65feb93dcc1279a70647a",
|
||||
"zh:f65da46b612049dd8354ba52f3a94b9f7fdc170bee7ca6922b008c54f09c652b",
|
||||
]
|
||||
}
|
||||
|
||||
@ -20,7 +20,6 @@ resource "aws_ecr_repository" "icecube2" {
|
||||
|
||||
resource "aws_s3_bucket" "cache" {
|
||||
bucket_prefix = "coax"
|
||||
acl = "private"
|
||||
|
||||
tags = {
|
||||
project = "coax"
|
||||
@ -28,6 +27,11 @@ resource "aws_s3_bucket" "cache" {
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_s3_bucket_acl" "cache" {
|
||||
bucket = aws_s3_bucket.cache.id
|
||||
acl = "private"
|
||||
}
|
||||
|
||||
resource "aws_s3_bucket_policy" "cache" {
|
||||
bucket = aws_s3_bucket.cache.id
|
||||
policy = data.aws_iam_policy_document.cache_access.json
|
||||
@ -102,14 +106,14 @@ data "aws_iam_policy_document" "github_actions_access" {
|
||||
}
|
||||
}
|
||||
|
||||
resource "github_actions_secret" "aws_account_id" {
|
||||
repository = data.github_repository.coax.name
|
||||
secret_name = "AWS_ACCOUNT_ID"
|
||||
plaintext_value = data.aws_caller_identity.current.account_id
|
||||
}
|
||||
|
||||
resource "github_actions_secret" "aws_iam_role" {
|
||||
repository = data.github_repository.coax.name
|
||||
secret_name = "AWS_IAM_ROLE"
|
||||
plaintext_value = aws_iam_role.github_actions.arn
|
||||
}
|
||||
|
||||
resource "github_actions_variable" "bitstream_cache_bucket" {
|
||||
repository = data.github_repository.coax.name
|
||||
variable_name = "BITSTREAM_CACHE_BUCKET"
|
||||
value = aws_s3_bucket.cache.id
|
||||
}
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
output "bitstream_cache_bucket" {
|
||||
value = aws_s3_bucket.cache.id
|
||||
description = "Use for BITSTREAM_CACHE_BUCKET environment variable"
|
||||
}
|
||||
@ -2,12 +2,12 @@ terraform {
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
version = "~> 3.0"
|
||||
version = "5.14.0"
|
||||
}
|
||||
|
||||
github = {
|
||||
source = "integrations/github"
|
||||
version = "~> 4.0"
|
||||
version = "5.34.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
62
.github/workflows/interface2_build.yml
vendored
62
.github/workflows/interface2_build.yml
vendored
@ -6,67 +6,78 @@ on:
|
||||
- interface2/**
|
||||
- .github/workflows/interface2_build.yml
|
||||
|
||||
# Required, for now, by aws-actions/configure-aws-credentials
|
||||
# Required by aws-actions/configure-aws-credentials for GitHub OIDC.
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
test_fpga:
|
||||
name: Test FPGA
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: interface2/fpga
|
||||
name: Test FPGA
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install Icarus Verilog
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install iverilog
|
||||
|
||||
- name: Run tests
|
||||
run: make tests
|
||||
|
||||
build_fpga:
|
||||
name: Build FPGA
|
||||
needs: test_fpga
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: interface2/fpga
|
||||
env:
|
||||
BITSTREAM_CACHE_BUCKET: coax20211004002809282500000001
|
||||
name: Build FPGA
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
# All history is required to determine the bitstream source SHA, otherwise
|
||||
# it may be unnecessarily rebuilt.
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@master
|
||||
uses: aws-actions/configure-aws-credentials@v3
|
||||
with:
|
||||
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
|
||||
aws-region: us-east-1
|
||||
- name: Get bitstream source SHA
|
||||
|
||||
- name: Get bitstream cache key
|
||||
run: |
|
||||
BITSTREAM_SOURCE_SHA=$(git log -n 1 --format=%H rtl)
|
||||
BITSTREAM_CACHE_KEY=interface2/fpga/$BITSTREAM_SOURCE_SHA.zip
|
||||
echo Bitstream source SHA is $BITSTREAM_SOURCE_SHA
|
||||
echo "BITSTREAM_SOURCE_SHA=$BITSTREAM_SOURCE_SHA" >> $GITHUB_ENV
|
||||
echo "BITSTREAM_CACHE_KEY=$BITSTREAM_CACHE_KEY" >> $GITHUB_ENV
|
||||
|
||||
- name: Check bitstream cache
|
||||
run: |
|
||||
BITSTREAM_CACHE_KEY=interface2/fpga/${BITSTREAM_SOURCE_SHA}.zip
|
||||
echo "BITSTREAM_CACHE_KEY=$BITSTREAM_CACHE_KEY" >> $GITHUB_ENV
|
||||
if aws s3api head-object --bucket $BITSTREAM_CACHE_BUCKET --key $BITSTREAM_CACHE_KEY; then
|
||||
if aws s3api head-object --bucket ${{ vars.BITSTREAM_CACHE_BUCKET }} --key ${{ env.BITSTREAM_CACHE_KEY }}; then
|
||||
echo Cached bitstream exists
|
||||
echo "BITSTREAM_CACHE_EXISTS=true" >> $GITHUB_ENV
|
||||
else
|
||||
echo Cached bitstream does not exist
|
||||
echo "BITSTREAM_CACHE_EXISTS=false" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Login to AWS ECR
|
||||
if: env.BITSTREAM_CACHE_EXISTS == 'false'
|
||||
id: aws_ecr_login
|
||||
uses: aws-actions/amazon-ecr-login@v1
|
||||
with:
|
||||
mask-password: 'true'
|
||||
|
||||
- name: Prepare iCEcube2
|
||||
if: env.BITSTREAM_CACHE_EXISTS == 'false'
|
||||
run: |
|
||||
@ -75,27 +86,31 @@ jobs:
|
||||
docker pull $ICECUBE2_IMAGE
|
||||
env:
|
||||
REGISTRY: ${{ steps.aws_ecr_login.outputs.registry }}
|
||||
|
||||
- name: Build bitstream
|
||||
if: env.BITSTREAM_CACHE_EXISTS == 'false'
|
||||
run: make rtl
|
||||
env:
|
||||
ICECUBE2_MAC_ADDRESS: ${{ secrets.ICECUBE2_MAC_ADDRESS }}
|
||||
|
||||
- name: Cache bitstream
|
||||
if: env.BITSTREAM_CACHE_EXISTS == 'false'
|
||||
run: |
|
||||
cd rtl
|
||||
zip cache.zip top.bin top_timing_report.txt
|
||||
aws s3 cp cache.zip s3://${BITSTREAM_CACHE_BUCKET}/${BITSTREAM_CACHE_KEY}
|
||||
aws s3 cp cache.zip s3://${{ vars.BITSTREAM_CACHE_BUCKET }}/${{ env.BITSTREAM_CACHE_KEY }}
|
||||
rm cache.zip
|
||||
|
||||
- name: Download cached bitstream
|
||||
if: env.BITSTREAM_CACHE_EXISTS == 'true'
|
||||
run: |
|
||||
cd rtl
|
||||
aws s3 cp s3://${BITSTREAM_CACHE_BUCKET}/${BITSTREAM_CACHE_KEY} cache.zip
|
||||
aws s3 cp s3://${{ vars.BITSTREAM_CACHE_BUCKET }}/${{ env.BITSTREAM_CACHE_KEY }} cache.zip
|
||||
unzip cache.zip
|
||||
rm cache.zip
|
||||
|
||||
- name: Attach bitstream
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: fpga_bitstream
|
||||
path: |
|
||||
@ -103,31 +118,38 @@ jobs:
|
||||
interface2/fpga/rtl/top_timing_report.txt
|
||||
|
||||
build_firmware:
|
||||
name: Build Firmware
|
||||
needs: build_fpga
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: interface2/firmware
|
||||
name: Build Firmware
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python 3.8
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.8
|
||||
|
||||
- name: Install PlatformIO
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install platformio
|
||||
|
||||
- name: Download bitstream
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: fpga_bitstream
|
||||
path: interface2/fpga/rtl
|
||||
|
||||
- name: Build firmware
|
||||
run: pio run
|
||||
|
||||
- name: Attach firmware
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: firmware
|
||||
path: interface2/firmware/.pio/build/default/firmware.bin
|
||||
|
||||
16
.github/workflows/pycoax_build.yml
vendored
16
.github/workflows/pycoax_build.yml
vendored
@ -8,30 +8,38 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: pycoax
|
||||
name: Build
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python 3.8
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.8
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install pylint build
|
||||
pip install -r requirements.txt
|
||||
|
||||
- name: Run linter
|
||||
run: pylint -E coax
|
||||
|
||||
- name: Run unit tests
|
||||
run: ./run_unit_tests.sh
|
||||
|
||||
- name: Build packages
|
||||
run: python -m build
|
||||
|
||||
- name: Attach packages
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: dist
|
||||
path: pycoax/dist/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user