adding other authors #85
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build And Test | |
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
branches: | |
- develop | |
workflow_dispatch: | |
env: | |
fabfed_image: fabfed:cicd | |
FABRIC_TOKEN: ${{ secrets.FABRIC_TOKEN }} | |
FABRIC_BASTION_KEY: ${{ secrets.FABRIC_BASTION_KEY }} | |
FABRIC_SLIVER_KEY: ${{ secrets.FABRIC_SLIVER_KEY }} | |
FABRIC_SLIVER_PUBKEY: ${{ secrets.FABRIC_SLIVER_PUBKEY }} | |
jobs: | |
DockerBuildAndTest: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build Image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: cicd/docker/Dockerfile | |
push: false | |
load: true | |
tags: ${{ env.fabfed_image }} | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache-new | |
- name: Run Unit Tests | |
run: | | |
docker run --rm -v ${{ github.workspace }}/tests:/tests -t ${{ env.fabfed_image }} pytest tests | |
- name: Test Stitch Policy | |
run: | | |
docker run --rm -t ${{ env.fabfed_image }} fabfed stitch-policy -providers "chi,fabric" | |
- name: Save Credentials | |
run: | | |
mkdir -p ${{ github.workspace }}/creds | |
echo ${{ env.FABRIC_TOKEN }} | base64 --decode > ${{ github.workspace }}/creds/token.json | |
echo ${{ env.FABRIC_BASTION_KEY }} | base64 --decode > ${{ github.workspace }}/creds/bastion | |
echo ${{ env.FABRIC_SLIVER_KEY }} | base64 --decode > ${{ github.workspace }}/creds/sliver | |
echo ${{ env.FABRIC_SLIVER_PUBKEY }} | base64 --decode > ${{ github.workspace }}/creds/sliver.pub | |
- name: Test Fabric L2 Bridge | |
run: | | |
docker run --rm \ | |
-e FABRIC_PROJECT=${{ secrets.FABRIC_PROJECT }} \ | |
-e FABRIC_USER=${{ secrets.FABRIC_USER }} \ | |
-v ${{ github.workspace }}/cicd:/cicd \ | |
-v ${{ github.workspace }}/creds:/creds \ | |
-t ${{ env.fabfed_image }} \ | |
/cicd/run-fabfed.sh cicd/test_configs/fabric fab-l2-bridge | |
- name: Test Facility Port With Defaul Vlan | |
run: | | |
docker run --rm \ | |
-e FABRIC_PROJECT=${{ secrets.FABRIC_PROJECT }} \ | |
-e FABRIC_USER=${{ secrets.FABRIC_USER }} \ | |
-v ${{ github.workspace }}/cicd:/cicd \ | |
-v ${{ github.workspace }}/creds:/creds \ | |
-t ${{ env.fabfed_image }} \ | |
/cicd/run-fabfed.sh cicd/test_configs/fabric_facility_port fab-facility-port | |
- name: Move cache | |
run: | | |
rm -rf /tmp/.buildx-cache | |
mv /tmp/.buildx-cache-new /tmp/.buildx-cache |