Chlod Aidan Alejandro efa3abecfd Add external use tests to build.yml (#5)
* make build.yml reproducible

`build.yml` is currently biased to succeed every time on this repository. Reasoning is that it will always checkout the actions' repository (which essentially transfers the actions' files to the "working directory", not the case if this action is being used externally), and it assumes that the action is run locally.

This commit breaks the build file into two parts: one that performs the current action as-is, and a new job which attempts to simulate usage from an external repository. In this job, no initial checkout is made and an immediate attempt at connecting to a ZeroTier network is made.

* trigger workflow run

* build.yml: only run test job on main

This forces the `test` job to only run if the workflow was triggered from the `main` branch. It wouldn't make sense to check if `main` works when using a different branch or tag, so this avoids doing that entirely.

`test` cannot automatically use the ref that triggered this workflow because `uses` does not take in expressions (and therefore cannot use `github.ref_name`).
2022-12-23 15:00:22 +01:00
2022-12-17 09:28:06 +01:00
2022-12-18 14:02:22 +01:00
2022-12-20 14:23:01 +01:00

ZeroTier GitHub Action

ZeroTier is an SDN platform that allows users to create virtual networks that can span multiple devices, locations, and cloud providers. ZeroTier creates an encrypted peer-to-peer mesh overlay network that handles NAT traversal and authentication to network resources.

The ZeroTier Github Action allows users to easily integrate ZeroTier into their CI/CD workflows by temporarily joining and authorizing runners onto private ZeroTier networks.

- name: ZeroTier
  uses: zerotier/github-action@v1
  with:
    network_id: ${{ secrets.ZEROTIER_NETWORK_ID }}
    auth_token: ${{ secrets.ZEROTIER_CENTRAL_TOKEN }}

ZEROTIER_CENTRAL_TOKEN can be provisioned from Account section in the ZeroTier Central admin panel.

This Action works on Ubuntu, MacOS, and Windows runners.


This action installs ZeroTier on the runner node and generates a unique ZeroTier identity.
It then uses the supplied auth_token to authorize the runner onto the network.

- name: ZeroTier
  uses: zerotier/github-action@v1
  with:
    network_id: ${{ secrets.ZEROTIER_NETWORK_ID }}
    auth_token: ${{ secrets.ZEROTIER_CENTRAL_TOKEN }}
    
- name: ping host
  shell: bash
  run: |
    count=10
    while ! ping -c 1 ${{ secrets.ZEROTIER_HOST_IP }} ; do
      echo "waiting..." ;
      sleep 1 ;
      let count=count-1
    done
    echo "ping success"

After the workflow has completed, a post step automatically cleans up by removing the runner from the network.

S
Description
No description provided
Readme 102 KiB
Languages
JavaScript 56.9%
Shell 37%
PowerShell 6.1%